Skip to content

Commit 4562f0a

Browse files
committed
add extra installation details to readme, add requirements.txt for py dependency installation
1 parent d100337 commit 4562f0a

3 files changed

Lines changed: 35 additions & 2 deletions

File tree

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This repository contains a modified version of Jay Zheng's draftaid-react projec
1919
## Installation and usage
2020
I have included a script that can be used for easy local deployment. In the top level of this project, use the command `./run.sh` from the terminal to have the project install, build, and run all at once. When built, the application will be served at [http://localhost:3000](http://localhost:3000).
2121

22-
Note: for the `fetch_fp.py` script you'll need to install a couple of dependencies, such as Selenium and Beautifulsoup. For the most part, they can just be installed by running `pip install <dependency>`, but pay attention to the logs for the exact package you'll need to install.
22+
Note: for the `fetch_fp.py` script you'll need to install a couple of dependencies, such as Selenium and Beautifulsoup (and Python+pip, of course). I've included a "requirements.txt" file that can be used with `pip` to fetch the dependencies: `pip3 install -r requirements.txt`
2323

2424
If you are interested in external web hosting, please see Jay Zheng's original repos for more details. This is a react-based project, so the commands required to run this application are:
2525

@@ -31,6 +31,35 @@ Note that you will need to have npm installed and configured on your machine.
3131

3232
Also note that you'll need geckodriver located in the `/data` folder, see the 2021 update blurb above for more details.
3333

34+
### Example of first-time usage:
35+
1. `pip3 install -r data/requirements.txt` to install the python dependencies with
36+
2. run `bash run.sh` to automate the rest of the process, which includes:
37+
- running the `fetch_fp.py` script
38+
- npm install, build, and start
39+
40+
## JSON Format
41+
42+
You are, of course, able to use your own rankings json with a bit of manual configuration. The format for the json is very primative; there are only two attributes, one of which contains an array of player data. It looks something like:
43+
44+
```
45+
{
46+
"format": $format, // where format is either standard, half_ppr, or ppr
47+
"rankings": [ // array of player data
48+
{
49+
"tier": 1
50+
"rank": 1
51+
"name": Christian McCaffrey
52+
"team": CAR
53+
"position": RB
54+
"bye_week": 13
55+
},
56+
...
57+
]
58+
}
59+
```
60+
61+
You will need to supply the files in the naming convention `rankings_$FORMAT.json`, where $FORMAT is either: `standard`, `half_ppr`, or `ppr`.
62+
3463
## Differences from the original application
3564

3665
Jay Zheng's original application is great out of the box. However, I wanted to tweak a few things before using it for my own fantasy draft purposes.
@@ -43,3 +72,5 @@ Jay Zheng's original application is great out of the box. However, I wanted to t
4372
## Kudos
4473

4574
Thank you to [Jay Zheng](https://github.com/jayjzheng) for creating this application, and elevating my draft results for (hopefully) many upcoming Fantasy Football seasons to come.
75+
76+
Kudos to kellenproctor for their PRs to draftaid-react! I was able to salvage the `fantasyProCsv.py` file to use a local player data .json file for the application from 2018 to 2020. This allowed for an extra ~200 data items for the application, which made it possible to track kickers and more defense options. While the script no longer works in 2021 and has since been removed from this repo, it served as the base idea for `fetch_fp.py`.

data/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
selenium==3.141.0
2+
beautifulsoup4==4.9.3

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "draftaid",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"private": true,
55
"devDependencies": {
66
"react-scripts": "0.9.0"

0 commit comments

Comments
 (0)