bball
Comprehensive NBA analytics platform for Python.
Features
- Core Models - Pydantic models for Players, Teams, Games, and Stats
- Advanced Analytics - Calculate true shooting %, PER, win shares, and more
- Data Fetching - Integration with NBA stats API
- CLI Tools - Command-line interface for quick analysis
- API Server - REST and GraphQL endpoints for your applications
- Reporting - Generate visualizations and reports
- Type Safe - Full type hints and runtime validation
Installation
# Install everything
pip install bball[all]
# Or install specific components
pip install bball # Just core models and utilities
pip install bball[cli] # Core + CLI
pip install bball[analytics] # Core + data, strategies, reports
pip install bball[api] # Core + API server
Quick Start
from bball import Player, Team, Game, Stats
# Create a player
player = Player(
id="203999",
name="Nikola Jokic",
team_id="DEN",
position="C",
height=83,
weight=284,
jersey_number=15
)
# Work with stats
from bball import calculate_advanced_stats
stats = Stats(
points=25.0,
rebounds=12.0,
assists=9.0,
field_goals_made=10,
field_goals_attempted=18,
# ... more stats
)
advanced = calculate_advanced_stats(stats)
print(f"True Shooting %: {advanced['true_shooting_pct']:.3f}")
Package Ecosystem
The bball ecosystem consists of a core package and optional extensions:
| Package | Description | Install |
|---|---|---|
| bball | Core models and utilities | pip install bball |
| bball-cli | Command-line interface | pip install bball[cli] |
| bball-api | REST/GraphQL API server | pip install bball[api] |
| bball-data | Data fetching and processing | pip install bball[data] |
| bball-strategies | Analysis strategies and ML models | pip install bball[strategies] |
| bball-reports | Report generation and visualization | pip install bball[reports] |
CLI Usage
# After installing bball[cli]
bball info # Show installed components
bball version # Show version information
Development
This project uses modern Python tooling and requires Python 3.13+.
# Clone the repository
git clone https://github.com/bball-dev/bball.git
cd bball
# Install uv package manager
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install all packages in development mode
# This automatically installs Python 3.13 and all dependencies
uv sync --all-packages
# Run tests
uv run pytest
# Run code quality checks
uv run ruff check src/ packages/
uv run ruff format src/ packages/
uv run pyright src/ packages/
For detailed development documentation, see docs/development.md.
Documentation
- Development Guide - Complete guide for contributors
- API Documentation - Full API reference
- Examples - Usage examples and tutorials
Contributing
Contributions are welcome! Please see our development guide for:
- Architecture overview
- Development workflow
- Testing strategy
- Publishing process
Quick Contribution Guide
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and quality checks (
uv run pytest && uv run ruff check) - Commit your changes (
git commit -m 'Add amazing feature') - Push to your branch (
git push origin feature/amazing-feature) - Open a Pull Request
Requirements
- Python 3.13+
- See
pyproject.tomlfor package-specific dependencies
Links
- Homepage: https://bball.dev
- Documentation: https://docs.bball.dev
- Repository: https://github.com/bball-dev/bball
- Issue Tracker: https://github.com/bball-dev/bball/issues
- PyPI: https://pypi.org/project/bball/
Credits
Built with:
Release files for bball 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bball-0.1.2.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bball-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.6 kB
Release files / bball-0.1.2.tar.gz
| Download URL | bball-0.1.2.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e5c05a122197bbc6fd55669daa34716de5f7648b59fa1d5e5a489675d84b5e36
|
|
BLAKE2b-256 checksum How to use checksums |
b1dd15594c260cbf212d38c8b91cc9fe6d2ca85b58ede29be2df14355cb22f76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.14
|
Release files / bball-0.1.2-py3-none-any.whl
| Download URL | bball-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9de6841dfeed97a753a7a851ad826129126669ca7f61abdd35fec9969556c11
|
|
BLAKE2b-256 checksum How to use checksums |
8541d3d6659e9aa3a9149eafaa1ef01fae62685355f064559a5e25a1d6dd5f3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.14
|