Skip to content

larrydor/NBA

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maintainability

GM Assist: NBA Free Agent Tracker Tool!

A Python application that utilizes National Basketball Association (NBA) focused APIs from sportradar.us to retrieve all team rosters and available free agents. This application allows a user to easily retrieve key information on team players and search for available free agents with an experience requirement if desired. Furthermore, we have added CSV functionality to seamlessly allow a user to export the free agents data.

Group Members

  • Alex Fleshner
  • Larry Doroger
  • Meghana Reddy

Prerequisites

  • Anaconda 3.7+
  • Python 3.7+
  • Pip

Installation

Fork this remote repository under your own control, then "clone" or download your remote copy onto your local computer.

Then navigate there from the command line (subsequent commands assume you are running them from the local repository's root directory):

cd ~/Desktop/NBA

Use Anaconda to create and activate a new virtual environment, perhaps called "nba-env":

conda create -n nba-env python=3.8
conda activate nba-env

After activating the virtual environment, install package dependencies (see the "requirements.txt" file):

pip install -r requirements.txt

NOTE: if this command throws an error like "Could not open requirements file: [Errno 2] No such file or directory", make sure you are running it from the repository's root directory, where the requirements.txt file exists (see the initial cd step above).

Setup

Sportradar.us API Setup

Signup for Sportradar.us API:

  1. Obtain a Sportradar.us API Key to be entered in the .env file as (api_key).

Environmental Variables Setup

Create a new file called ".env" in the root directory of this repo, then copy the contents below into it, adapting the values to match the api_key from Sportradar.us.

# the .env file

api_key="abc123"

NOTE: the ".env" file is usually the place for passing configuration options and secret credentials, so as a best practice we don't upload this file to version control (which is accomplished via a corresponding entry in the ".gitignore" file). This means we need to instruct each person who uses our code needs to create their own local ".env" file.

Usage

Run the Python script:

python app/nba_search.py

NOTE: if you see an error like "ModuleNotFoundError: No module named '...'", it's because the given package isn't installed, so run the pip command above to ensure that package has been installed into the virtual environment.

Testing

Running tests:

pytest

Reference

Thank you to Professor Rossetti for providing great instruction and assistance during this course! As well as a reference README file and CSV module configuration instructions within GitHub.

  1. Source: https://raw.githubusercontent.com/prof-rossetti/my-first-python-app/main/README.md
  2. Source: https://github.com/prof-rossetti/intro-to-python/blob/main/notes/python/modules/csv.md

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%