Skip to content

Commit 48545c0

Browse files
committed
update query to force inclusion of game_code, add support for transactions that include FAAB and/or draft picks, update docs, add simple Docker usage, and update package
1 parent fc62699 commit 48545c0

File tree

279 files changed

+14567
-2304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+14567
-2304
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# macOS
2+
**.DS_Store
3+
4+
# JetBrains
5+
.idea/
6+
7+
# Python
8+
**__pycache__
9+
**.pytest_cache
10+
11+
# environment
12+
**.env*
13+
!**.env.template*
14+
.venv
15+
16+
# auth secrets
17+
**private*.json
18+
!**private.template.json
19+
**token*.json
20+
!**token.template.json
21+
22+
# Docker
23+
compose*.yaml
24+
.dockerignore
25+
docker/Dockerfile

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Bug Report
3-
about: 'Report any bugs, errors, problems, etc. found in the FFMWR app. '
3+
about: 'Report any bugs, errors, problems, etc. found in YFPY. '
44
title: "[Bug] Short Description of Erroneous/Problematic Behavior"
55
labels: bug
66
assignees: uberfastman
@@ -12,14 +12,14 @@ Please put a longer description of the bug/issue/problem you are encountering he
1212

1313
## Additional Information as Applicable
1414

15-
#### Fantasy Football Platform
16-
Yahoo/ESPN/Sleeper/Fleaflicker
17-
18-
#### League ID
15+
#### Yahoo Fantasy Sports League ID
1916
XXXXXX...
2017

21-
#### Operating System
22-
macOS/Windows/Linux
18+
#### Yahoo Fantasy Sports League Privacy
19+
Public/Private
20+
21+
#### Operating System/Environment
22+
macOS/Windows/Linux/Docker/etc.
2323

2424
#### Other
2525
Any other setup/environment/configuration information you might deem potentially relevant.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
name: Feature Request
3-
about: Suggest a new idea/feature for the FFMWR app.
3+
about: Suggest a new idea/feature for YFPY.
44
title: "[Feature Request] Short Description of New Idea/Feature"
55
labels: feature
66
assignees: ''
77

88
---
99

1010
## Description
11-
Please describe what new idea/feature would like to see added to the app.
11+
Please describe what new idea/feature would like to see added to the YFPY package.
1212

1313
## Use case
14-
Please elaborate on how your idea/feature request will be provide additional value and/or interesting information beyond what is already included in the generated reports.
14+
Please elaborate on how your idea/feature request will provide additional value/functionality.

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ dist/
2020
test_output/
2121

2222
# Environment
23-
*.env
23+
*.env*
24+
!.env.template
2425
*.venv
25-
!EXAMPLE.env
2626
.python-version
2727

2828
# Credentials
2929
*private*.json
30-
!EXAMPLE.private.json
30+
!private.template.json
3131
*token*.json

MANIFEST.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ include requirements.txt
99
include dev-requirements.txt
1010

1111
# Include Yahoo Fantasy Sports REST API authentication resources
12-
include auth/EXAMPLE.private.json
13-
include auth/EXAMPLE.env
12+
include auth/private.template.json
13+
include auth/.env.template
14+
15+
# Include YFPY Docker resources
16+
include compose.yaml
1417

1518
# Include quickstart resources
1619
include quickstart/quickstart.py

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ In order to use YFPY with private fantasy leagues, you must set up an app on you
9191
* `API Permissions` (**Required**): check the `Fantasy Sports` checkbox. You can leave the `Read` option selected (appears in an accordion expansion underneath the `Fantasy Sports` checkbox once you select it).
9292
* Click the `Create App` button.
9393
* Once the app is created, it should redirect you to a page for your app, which will show both a `Client ID` and a `Client Secret`.
94-
* Make a copy of [`auth/EXAMPLE.private.json`](https://github.com/uberfastman/yfpy/blob/main/auth/EXAMPLE.private.json), rename it to just `private.json`, and copy the `Client ID` and `Client Secret` values to their respective fields (make sure the strings are wrapped regular quotes (`""`), NOT formatted quotes (`“”`)). The path to this file will be needed to point YFPY to your credentials.
94+
* Make a copy of [`auth/private.template.json`](https://github.com/uberfastman/yfpy/blob/main/auth/private.template.json), rename it to just `private.json`, and copy the `Client ID` and `Client Secret` values to their respective fields (make sure the strings are wrapped regular quotes (`""`), NOT formatted quotes (`“”`)). The path to this file will be needed to point YFPY to your credentials.
9595
* Now you should be ready to initialize the OAuth2 connection between YFPY your Yahoo account.
9696

9797
---
@@ -113,6 +113,34 @@ In order to use YFPY with private fantasy leagues, you must set up an app on you
113113
* Uncomment/comment out whichever query lines in the `RUN QUERIES` section you wish to run.
114114
* Uncomment/comment out whichever query lines in the `CHECK FOR MISSING DATA FIELDS` section you wish to check for any new/missing data fields returned by the Yahoo Sports Fantasy Football API.
115115

116+
#### Docker
117+
118+
YFPY can be used within Docker for a more seamless, platform-agnostic experience.
119+
120+
* Build the Docker image:
121+
```shell
122+
docker compose build
123+
```
124+
* Run the Docker container:
125+
```shell
126+
docker compose up
127+
```
128+
* You can then run commands in the Docker container in two different ways:
129+
* Connect to the running container and run commands from within it:
130+
```shell
131+
docker exec -it yfpy-package-1 bash
132+
```
133+
Then:
134+
```shell
135+
python quickstart/quickstart.py
136+
```
137+
* Send commands to the running container from your host machine:
138+
```shell
139+
docker exec -i yfpy-package-1 bash -c "python quickstart/quickstart.py"
140+
```
141+
142+
***NOTE***: *If you wish to actively make changes to or develop against YFPY within the Docker container, uncomment the `- .:/opt/yfpy` volume mount in [`compose.yaml`](https://github.com/uberfastman/yfpy/blob/main/compose.yaml) so that any code changes you make in YFPY are reflected inside the running container.*
143+
116144
---
117145

118146
<a name="testing"></a>
@@ -127,7 +155,7 @@ YFPY has a collection of fully functional code snippets that can be run using [p
127155
#### Integration
128156

129157
* See the [`test/integration`](https://github.com/uberfastman/yfpy/blob/main/test/integration/) directory for example code snippets using pytest.
130-
* Before running any integration tests, make a copy of [`auth/EXAMPLE.env`](https://github.com/uberfastman/yfpy/blob/main/auth/EXAMPLE.env) in the [`auth/`](https://github.com/uberfastman/yfpy/blob/main/auth/) directory and rename it to `.env`.
158+
* Before running any integration tests, make a copy of [`auth/.env.template`](https://github.com/uberfastman/yfpy/blob/main/auth/.env.template) in the [`auth/`](https://github.com/uberfastman/yfpy/blob/main/auth/) directory and rename it to `.env`.
131159
* Copy your Yahoo `Client ID` and `Client Secret` into the environment variables in `.env` so that pytest can use them when hitting the Yahoo Fantasy Sports API.
132160
* If this is the first time running pytest with your Yahoo API credentials, you ***MUST*** allow interactive prompts within pytest by using the `-s` flag.
133161
* The fixture values in [`test/integration/conftest.py`](https://github.com/uberfastman/yfpy/blob/main/test/integration/conftest.py) are defined in [`quickstart/quickstart.py`](https://github.com/uberfastman/yfpy/blob/main/quickstart/quickstart.py), and can be changed for testing by uncommenting/commenting out the values inside each respective function.

VERSION.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# DO NOT EDIT - VERSIONING CONTROLLED BY GIT TAGS
2-
__version__ = "v13.0.0"
2+
__version__ = "v14.0.0"
File renamed without changes.

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
- PYTHON_VERSION_MINOR=11
88
context: .
99
dockerfile: docker/Dockerfile
10-
image: ghcr.io/uberfastman/yfpy:13.0.0 # DO NOT EDIT IMAGE - VERSIONING CONTROLLED BY GIT TAGS
10+
image: ghcr.io/uberfastman/yfpy:14.0.0 # DO NOT EDIT IMAGE - VERSIONING CONTROLLED BY GIT TAGS
1111
platform: linux/amd64
1212
environment:
1313
- RUNTIME_ENVIRONMENT=docker

docker/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
ARG PYTHON_VERSION_MAJOR=$PYTHON_VERSION_MAJOR
2+
ARG PYTHON_VERSION_MINOR=$PYTHON_VERSION_MINOR
3+
4+
# set base image
5+
FROM --platform=linux/amd64 python:${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}-slim
6+
7+
LABEL "org.opencontainers.image.source"="https://github.com/uberfastman/yfpy"
8+
9+
# update package index list
10+
RUN apt update && \
11+
apt upgrade && \
12+
apt install -y git
13+
14+
# set the working directory in the container
15+
WORKDIR /opt/yfpy
16+
17+
# set python environment variables
18+
ENV PYTHONDONTWRITEBYTECODE 1
19+
ENV PYTHONUNBUFFERED 1
20+
21+
## copy the project root contents to the working directory
22+
COPY .. .
23+
24+
# install dependencies
25+
RUN pip install --upgrade pip && \
26+
pip install -r requirements.txt
27+
28+
RUN chmod +x ./docker/docker-entrypoint.sh
29+
30+
# specify docker as package runtime environment
31+
ENV RUNTIME_ENVIRONMENT docker
32+
33+
ENTRYPOINT ["./docker/docker-entrypoint.sh"]
34+
35+
# command to run on container start
36+
CMD tail -f /dev/null

docker/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
# startup message
4+
/bin/echo "YFPY is ready!"
5+
6+
# execute CMD from Dockerfile
7+
exec "$@"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
yfpy.models.Pick
2+
================
3+
4+
.. currentmodule:: yfpy.models
5+
6+
.. autoclass:: Pick
7+
:members:
8+
:show-inheritance:
9+
:inherited-members:
10+
:special-members: __call__, __add__, __mul__
11+
12+
13+
14+
.. rubric:: Methods
15+
16+
.. autosummary::
17+
:nosignatures:
18+
19+
~Pick.clean_data_dict
20+
~Pick.from_json
21+
~Pick.serialized
22+
~Pick.subclass_dict
23+
~Pick.to_json
24+
25+
26+
27+
28+
29+

docs-sphinx/source/_autosummary/yfpy.models.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
OutcomeTotals
3939
Ownership
4040
PercentOwned
41+
Pick
4142
Player
4243
PlayerAdvancedStats
4344
PlayerPoints

docs-sphinx/source/_autosummary/yfpy.query.YahooFantasySportsQuery.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,6 @@
7171
.. autosummary::
7272

7373
~YahooFantasySportsQuery.YFO
74+
~YahooFantasySportsQuery.runtime_environment_is_docker
7475

7576

docs/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 97ec4bc4af03b9613a945ece5253f01a
3+
config: 325f953d1e0471bd06261a26c996b30e
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

0 commit comments

Comments
 (0)