Unofficial Python SDK and CLI for the GameSheet Inc. platform — automates WebUI procedures where a native API is absent.
Project description
gamesheet-sdk-py
Unofficial Python SDK and command-line interface for the GameSheet Inc. platform.
⚠️ Disclaimer
This project is not affiliated with, endorsed by, or sponsored by GameSheet Inc. GameSheet Inc. does not publish a public REST/GraphQL API for the operations this SDK covers. Where a native API is absent, this library automates the GameSheet WebUI (using HTTP requests, HTML parsing, and headless-browser automation).
Because this approach depends on third-party UI structure, it may break without warning when GameSheet ships changes. Check the GitHub Releases page before upgrading in production.
Use of this software must comply with the GameSheet Inc. Terms of Service. You are responsible for any automation you perform.
Quick Links
- Documentation — Full documentation (tutorials, how-tos, API reference)
- Installation — Get started quickly
- Quick Start — First commands to try
- CLI Reference — Command-line usage
- Configuration — Environment variables and settings
- Development Setup — Contributing guide
- Release Process — Automated releases with Conventional Commits
- CHANGELOG — Release history
Features
- Authentication — Browser-driven login flow with persistent session storage
- Resource-oriented CLI — Intuitive verb-noun command structure with aliases (
ls,rm,get, etc.) - Comprehensive resource coverage — Manage associations, leagues, seasons, divisions, teams, games, referees, rosters (players & coaches), locations, and broadcasters
- Python API — Fully typed Python SDK with pydantic models for all resources
- Multiple output formats — JSON, YAML, CSV, TSV, or 13 tabulate table formats
- Shell completion — Tab completion for bash, zsh, fish
- Typed (PEP 561) — Ships
py.typedmarker, passesmypy --strict - 100% test coverage — Comprehensive test suite with VCR cassettes and browser automation tests
- Automated releases — Conventional Commits + python-semantic-release
- Docker support — Pre-built container images with Playwright bundled
Requirements
- Python 3.11+ (3.11, 3.12, 3.13, or 3.14)
- Chromium (managed by Playwright) — required for login flow
Installation
Via PyPI
pip install gamesheet-sdk-py
# Install Playwright browser (required for login)
python -m playwright install chromium
Via Docker
Pre-built images include Playwright (Chromium) for seamless browser automation.
# Pull the latest image from GitHub Container Registry
docker pull ghcr.io/bdperkin/gamesheet-sdk-py:latest
# Run the CLI
docker run --rm ghcr.io/bdperkin/gamesheet-sdk-py:latest --help
# Run with persistent session storage (recommended for multi-command workflows)
docker run --rm -v ~/.gamesheet:/home/gamesheet/.gamesheet \
ghcr.io/bdperkin/gamesheet-sdk-py:latest associations list
# Example: login and list associations
docker run -it --rm -v ~/.gamesheet:/home/gamesheet/.gamesheet \
-e GAMESHEET_USERNAME=you@example.com \
-e GAMESHEET_PASSWORD=secret \
ghcr.io/bdperkin/gamesheet-sdk-py:latest login
docker run --rm -v ~/.gamesheet:/home/gamesheet/.gamesheet \
ghcr.io/bdperkin/gamesheet-sdk-py:latest associations list --format json
Available Docker tags:
latest— most recent release from main branch<version>— specific version (e.g.,0.2.2,0.2,0)<branch>-<sha>— specific commit for traceability
From Source
git clone https://github.com/bdperkin/gamesheet-sdk-py.git
cd gamesheet-sdk-py
pip install -e ".[all]"
python -m playwright install chromium
# Or build the Docker image locally
make docker-build
make docker-run
See Development Setup for detailed instructions.
Available Resources
The CLI and Python API provide comprehensive coverage of GameSheet resources:
| Resource | CLI Command | Description |
|---|---|---|
| Associations | associations |
Top-level organizational units |
| Leagues | leagues |
Leagues within associations |
| Seasons | seasons |
Seasons within leagues |
| Divisions | divisions |
Divisions within seasons |
| Teams | teams |
Teams within divisions |
| Games | games scheduled, games completed, games brackets |
Scheduled, completed, and bracket games |
| Referees | referees |
Referee management and reports |
| Roster | roster players, roster coaches |
Season-level roster management |
| Team Roster | teams roster players, teams roster coaches |
Team-level roster management |
| Locations | locations |
Game locations and venues |
| iPad Keys | ipad-keys |
iPad scoring access keys |
Each resource supports intuitive verbs: list (or ls), get (or show/view), create (or add/new), update (or set/edit), delete (or
rm/remove) where applicable. Most resources default to list when invoked without a verb (e.g., gamesheet-sdk-py associations runs list).
Quick Start
CLI
# Authenticate (credentials can also come from env vars)
gamesheet-sdk-py login --email you@example.com
# List associations
gamesheet-sdk-py associations list --format json
# Shorthand: gamesheet-sdk-py associations (default=list)
# List leagues in an association
gamesheet-sdk-py leagues list 38 --format json
# List seasons in a league
gamesheet-sdk-py seasons list 1148580 --format json
# Get season details
gamesheet-sdk-py seasons get --season-id 15020 --format json
# Get iPad/Scoring keys
gamesheet-sdk-py ipad-keys get 15020 --format json
# Manage divisions
gamesheet-sdk-py divisions list --season-id 15020 --format json
gamesheet-sdk-py divisions create --season-id 15020 --name "Bantam A" --format json
# Manage teams
gamesheet-sdk-py teams list --division-id 123 --format json
gamesheet-sdk-py teams create --division-id 123 --name "Hawks" --format json
# List games (scheduled, completed, brackets)
gamesheet-sdk-py games scheduled --season-id 15020 --format json
gamesheet-sdk-py games completed --season-id 15020 --format json
gamesheet-sdk-py games brackets --season-id 15020 --format json
# Manage referees
gamesheet-sdk-py referees list --season-id 15020 --format json
gamesheet-sdk-py referees get --referee-id 456 --format json
# Manage roster (players and coaches)
gamesheet-sdk-py roster players list --season-id 15020 --format json
gamesheet-sdk-py roster coaches list --season-id 15020 --format json
# Tab completion setup
gamesheet-sdk-py completion bash > ~/.gamesheet-sdk-completion.bash
source ~/.gamesheet-sdk-completion.bash
See the CLI Reference for complete usage.
Python API
from gamesheet_sdk import (
AuthenticatedSession,
Config,
get_season,
list_associations,
list_divisions,
list_ipad_keys,
list_leagues,
list_seasons,
list_teams,
load_access_token,
load_refresh_token,
save_tokens,
)
# Configure and authenticate
config = Config()
access = load_access_token(config)
refresh = load_refresh_token(config)
with AuthenticatedSession(
config,
access_token=access or "",
refresh_token=refresh or "",
on_refresh=lambda tokens: save_tokens(config, **tokens),
) as session:
# List all associations
for assoc in list_associations(session):
print(f"Association: {assoc.title}")
# List leagues
for league in list_leagues(session, assoc.id):
print(f" League: {league.title}")
# List seasons
for season in list_seasons(session, league.id):
print(f" Season: {season.title}")
# Get detailed season info
detail = get_season(session, season.id)
print(f" Sport: {detail.sport}")
# Get iPad keys
keys = list_ipad_keys(session, season.id)
for key in keys:
print(f" Key: {key.value}")
# List divisions
divisions = list_divisions(session, season.id)
for division in divisions:
print(f" Division: {division.name}")
# List teams in division
teams = list_teams(session, division.id)
for team in teams:
print(f" Team: {team.name}")
All functions return fully typed pydantic models with comprehensive field validation.
Configuration
Configuration via environment variables or CLI flags. See Configuration Reference for details.
export GAMESHEET_USERNAME=you@example.com
export GAMESHEET_PASSWORD=secret
export GAMESHEET_TIMEOUT=60
gamesheet-sdk-py login
Documentation
Full documentation is available at https://bdperkin.github.io/gamesheet-sdk-py/
The docs follow the Diátaxis framework:
- Tutorials — Step-by-step learning guides
- How-To Guides — Task-oriented recipes
- Reference — API and CLI documentation
- Explanation — Understanding the architecture
Project Status
Status: Alpha — Active development, breaking changes possible before 1.0.0
- Current version: 0.2.2
- Python support: 3.11, 3.12, 3.13, 3.14
- Version strategy: Patch-only bumps until 1.0.0 (see Release Process)
- Test coverage: 100% (enforced locally and via Codecov)
- Type checking:
mypy --strictandpyrightpass on all source code - Code quality: All blocks maintain cyclomatic complexity grade A (cc ≤ 5)
- CI/CD: Comprehensive test matrix across Python versions, multi-OS testing (nightly), security scanning (Bandit, Semgrep, Trivy, GitGuardian, OSV-Scanner, CodeQL), and automated PyPI releases
Contributing
Contributions are welcome! Before opening a PR:
- Read Development Setup
- Follow Conventional Commits format
- Ensure tests pass:
pytest --cov - Run quality gates:
pre-commit run --all-files - Maintain 100% test coverage
- Keep complexity at grade A (run
make metrics)
See CONTRIBUTING.md for detailed guidelines. We follow the Contributor Covenant Code of Conduct.
Security
Security is a top priority. This project employs multiple layers of automated security scanning:
- Static analysis: Bandit (Python), Semgrep (SAST), CodeQL (semantic analysis)
- Dependency scanning: OSV-Scanner, pip-audit
- Container scanning: Trivy (with CVE suppression documented in
.trivyignore) - Secret detection: GitGuardian
- Code quality: Pre-commit hooks enforce security best practices
Reporting vulnerabilities: See SECURITY.md. Please use the private reporting channel — do not open public issues for security reports.
License
Distributed under the MIT License. © 2026 bdperkin.
Support
Need help? See SUPPORT.md for:
- Common issues and solutions
- How to ask questions (GitHub Discussions)
- How to report bugs (GitHub Issues)
- Response time expectations
Links
- PyPI: https://pypi.org/project/gamesheet-sdk-py/
- Documentation: https://bdperkin.github.io/gamesheet-sdk-py/
- Source: https://github.com/bdperkin/gamesheet-sdk-py
- Issues: https://github.com/bdperkin/gamesheet-sdk-py/issues
- Discussions: https://github.com/bdperkin/gamesheet-sdk-py/discussions
- Changelog: CHANGELOG.md
- Releases: https://github.com/bdperkin/gamesheet-sdk-py/releases
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gamesheet_sdk_py-0.2.3.tar.gz.
File metadata
- Download URL: gamesheet_sdk_py-0.2.3.tar.gz
- Upload date:
- Size: 273.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e633a9d282f8e78289f2fe777118d16b9ab8e557f5e2d76194c3f2fbae081bf
|
|
| MD5 |
21548b9d95f84dcc2301bc2b0e7f41eb
|
|
| BLAKE2b-256 |
5542876359dd1e634a87d020836e9fe3bd3f0b43eb82ee9c1801209baf9eb31e
|
Provenance
The following attestation bundles were made for gamesheet_sdk_py-0.2.3.tar.gz:
Publisher:
release.yml on bdperkin/gamesheet-sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gamesheet_sdk_py-0.2.3.tar.gz -
Subject digest:
1e633a9d282f8e78289f2fe777118d16b9ab8e557f5e2d76194c3f2fbae081bf - Sigstore transparency entry: 2119278630
- Sigstore integration time:
-
Permalink:
bdperkin/gamesheet-sdk-py@b8bf3c535f3d4d107de3a5e2fe2f40baeedc931a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bdperkin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b8bf3c535f3d4d107de3a5e2fe2f40baeedc931a -
Trigger Event:
push
-
Statement type:
File details
Details for the file gamesheet_sdk_py-0.2.3-py3-none-any.whl.
File metadata
- Download URL: gamesheet_sdk_py-0.2.3-py3-none-any.whl
- Upload date:
- Size: 154.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e297dcad9a4d16df449dfbfb4d013c4f7749af59c8e9161621ff77018e89a12
|
|
| MD5 |
81304c5f2b3b0f830f1d039641f41b72
|
|
| BLAKE2b-256 |
323c55e0167b0bebd0ffd50076e081e904c992ce1966e1a93beac4f5bcbf6ef0
|
Provenance
The following attestation bundles were made for gamesheet_sdk_py-0.2.3-py3-none-any.whl:
Publisher:
release.yml on bdperkin/gamesheet-sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gamesheet_sdk_py-0.2.3-py3-none-any.whl -
Subject digest:
7e297dcad9a4d16df449dfbfb4d013c4f7749af59c8e9161621ff77018e89a12 - Sigstore transparency entry: 2119278685
- Sigstore integration time:
-
Permalink:
bdperkin/gamesheet-sdk-py@b8bf3c535f3d4d107de3a5e2fe2f40baeedc931a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bdperkin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b8bf3c535f3d4d107de3a5e2fe2f40baeedc931a -
Trigger Event:
push
-
Statement type: