Scouting App Code for the 2024 FRC Season
to install and store the Pypi packages, you need to download miniconda
miniconda
NOTE: if you're on an apple M1 computer, downloadMiniconda3 macOS Apple M1 64-bit bash
and if you're not, downloadMiniconda3 macOS Intel x86 64-bit bash
- open up your terminal
- search: F4 > terminal
- use the following in order (case sensitive)
cd downloads
ls -l
- then go and find where your miniconda install is located EX: Miniconda3-latest-MacOSX-arm64.sh
./Miniconda-latest(filename)
- If you don't have permissions to download it, do the command
chmod +x ./Miniconda…
- If you don't have permissions to download it, do the command
- read through the user agreement, READ IT, and THEN type
yes
in the terminal eval "(/Users/(name)/miniconda3/bin/conda shell.(name) hook)"
conda init
- install and initialize the pypi packages by making a conda environment in VSCode
- now that ypu've initialized the download for miniconda, move into VSCode and open a new terminal (ctrl + shift + `)
conda create -n (environment name) python=3.11
we are using python 3.11.3, so be sure to state what python version we're usingconda activate (environment name)
this should've moved you into the environment you've created
- below this are all of the pypi packages you will need to download, install all of them with the Linux/Apple command (
python3 -m pip install --upgrade Flask google-api-python-client google-auth-httplib2 google-auth-oauthlib waitress
). after you've done that, run the app usingpython3 main.py
. - after that go into any browser and type
localhost:80
and thats it
if the app gives you an error about a token being missing when you run the python3 command, that means you dont have the apikeys.json file or api token. follow from step 2 to 2b to get that problem resolved.
(hey, this is max. for now (as in as im still on the team) don't generate a new token. If you need the token just @ me on the discord or in dm's and ill give it to you. if you do end up generating a token, PLEASE send it to me so I can share it to others. if you're not on the discord or know me on discord at all, email me at maxmaginnis@yahoo.com
. thanks for the cooperation.)
Install With
- Windows:
py -m pip install --upgrade Flask google-api-python-client google-auth-httplib2 google-auth-oauthlib waitress
- Linux/Apple:
python3 -m pip install --upgrade Flask google-api-python-client google-auth-httplib2 google-auth-oauthlib waitress
-
git pull https://github.com/cavineers/ScoutingApp-GEN
-
Follow (most of) this tutorial to help get everything set up: https://developers.google.com/sheets/api/quickstart/python
2a. Setup OAuth for your Google Cloud Project and put the generated JSON in in file
ScoutingApp-GEN/token.json
Diagram:
{ "Sheets OAuth": ... }
- Sheets OAuth
- The OAuth JSON generated by Google Cloud
- type:
dict[str, str]
2b. During first runtime, click the OAuth concent link printed to the console
- If you already did so and have generated the
ScoutingApp-GEN/token.json
file, this file can be moved into other instances of the app to use the same token. - Note: The token will eventually expire, so the
token.json
file must be deleted and regenerated with the OAuth concent link, and any copies must be replaced with the new token.
- Sheets OAuth
The following commands must be ran in the repository directory.
Quickly run the flask app on 0.0.0.0:80
with
- Windows:
py main.py
- Linux/Apple:
python3 main.py
Specify IP and port to host with
- Windows:
py -m ScoutingApp.__main host=<ip> port=<port>
- Linux/Apple:
python3 -m ScoutingApp.__main host=<ip> port=<port>
hey, you, yes you, whoever you may be in the future, if you want to contact us or have any questions about the scouting app, do so by emailing us!
Max Maginnis : maxmaginnis@yahoo.com
Jake Goodyear : jakengoodyear@gmail.com
Charles Hecker : thecheckerbro2007@gmail.com
Do not delete the coconut -Maginnis and Goodyear