The following setup instructions are intended for developer use only! For information about how to set up the Fantasy Football Metrics Weekly Report app for regular usage, please see the setup documentation HERE for more information.
-
Make sure your operating system (OS) has the correct version of Python installed (see the main README.md section on dependencies for instructions).
-
After you've finished installing Python, check that it has been successfully installed by running
python3 --version
(orpy -0p
(orpy -3
to see if you can launch Python 3 ifpy -0p
fails) if using the Python launcher for Windows in Windows to list installed Python version with their paths) in the command line again, and confirming that it outputsPython 3.x.x
. If it does not, double check that you followed all Python installation steps correctly. -
Open a command line prompt
-
macOS: type
Cmd + Space
(⌘ + Space
) to bring up Spotlight, and search for "Terminal" and hit enter). -
Windows: type
Windows + R
to open the "Run" box, then typecmd
and then click "OK" to open a regular Command Prompt (or typecmd
and then pressCtrl + Shift + Enter
to open an administrator Command Prompt) -
Linux: type
Ctrl+Alt+T
(in Ubuntu).
-
-
Install
git
(if you do not already have it installed). You can see instructions for installation on your OS here. If you are comfortable using the command line, feel free to just installgit
for the command line. However, if using the command line is not something you have much experience with and would prefer to do less in a command line shell, you should install Git for Desktop. -
Clone this project to whichever directory you wish:
-
If you already have an account on GitHub, then I recommend using SSH to connect with GitHub.
-
If using SSH (as described in the link above), run:
git clone [email protected]:uberfastman/fantasy-football-metrics-weekly-report.git
- If not using SSH, then use HTTPS by running:
git clone https://github.com/uberfastman/fantasy-football-metrics-weekly-report.git
-
-
Run
cd fantasy-football-metrics-weekly-report
to enter the project directory. -
Set up a virtual environment:
-
macOS/Linux:
-
Run
pip3 install virtualenv virtualenvwrapper
(if not already installed). -
Run
touch ~/.bashrc
. -
Run
echo 'export WORKON_HOME=$HOME/.virtualenvs' >> ~/.bashrc echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bashrc
-
Run
source ~/.bashrc
-
Run
which python3
. This should output something like/usr/local/bin/python3
. Copy that path for the next step.
-
-
Windows:
-
Run
pip3 install virtualenv virtualenvwrapper-win
-
Details for using
virtualenvwrapper-win
can be found here.
-
-
-
Run
mkvirtualenv -p /usr/local/bin/python3 fantasy-football-metrics-weekly-report
. -
When the previous command is finished running, your command line prompt should now look something like this:
(fantasy-football-metrics-weekly-report) [username@Computer 02:52:01 PM] ~/fantasy-football-metrics-weekly-report $
Congratulations, you have successfully created a Python 3 virtual environment for the project to run in!
-
Finally, run
pip install -r requirements.txt -r requirements-dev.txt
.
-
If you followed the setup instructions and set up the application to run in a virtual environment, once you have navigated to the project directory, you MUST run
workon fantasy-football-metrics-weekly-report
before running the report EVERY TIME you open a new command line prompt to run the application!
-
Make sure you have updated the default league ID (
league_id
value) in the.env
file to your own league id. Please see the respective setup instructions for your chosen platform for directions on how to find your league ID. -
Run
python main.py
. You should see the following prompts:-
Generate report for default league? (y/n) ->
.Type
y
and hit enter. -
Generate report for default week? (y/n) ->
.Type
y
and hit enter. -
The FIRST time you run the app, a browser window will automatically open, and if you correctly followed the instructions in the Report Setup section, you should see a verifier code (something like
w6nwjvz
). -
Copy the above verifier code and return to the command line window, where you should now see the following prompt:
Enter verifier :
Paste the verifier code there and hit enter.
-
Assuming the above went as expected, the application should now generate a report for your fantasy league for the selected NFL week.
-
NOTE: You can also specify a large number of settings directly in the command line. Please see the usage section for more information.
When you are done working within the virtualenv
, you can run deactivate
within the environment to exit:
(fantasy-football-metrics) host-machine: fantasy-football-metrics-weekly-report $ deactivate
When you wish to work within the virtualenv
once more, do the following:
-
Run
source ~/.bashrc
-
View
virtualenvs
that you have available:lsvirtualenv
-
Run
workon fantasy-football-metrics-weekly-report
(or whatever you named your virtual environment for the application).