Edgework - NHL API Client
A Python client library for interacting with NHL APIs, providing easy access to player statistics, team information, schedules, and more.
🏒 Features
- Player Data: Access active and historical player information
- Statistics: Get skater and goalie statistics with flexible filtering
- Team Information: Retrieve team rosters, stats, and schedules
- Game Data: Access game schedules and results
- Easy to Use: Simple, intuitive API with comprehensive documentation
📦 Installation
pip install edgework
🚀 Quick Start
from edgework import Edgework
# Initialize the client
client = Edgework()
# Get active players
players = client.players(active_only=True)
print(f"Found {len(players)} active players")
# Get top scorers
top_scorers = client.skater_stats(
season="2023-2024",
sort="points",
limit=10
)
for player in top_scorers:
print(f"{player.name}: {player.points} points")
📚 Documentation
Full documentation is available at: https://problemxl.github.io/edgework/
Local Documentation
To view documentation locally:
# Install documentation dependencies
pip install mkdocs mkdocs-material mkdocstrings[python] pymdown-extensions
# Serve documentation locally
mkdocs serve
# Or use the helper script
python docs.py serve
The documentation will be available at http://127.0.0.1:8000/edgework/
🔧 API Reference
Main Client
from edgework import Edgework
client = Edgework(user_agent="MyApp/1.0") # Optional custom user agent
Player Methods
client.players(active_only=True)- Get player listclient.skater_stats(season, ...)- Get skater statisticsclient.goalie_stats(season, ...)- Get goalie statistics
Team Methods
client.team_stats(season, ...)- Get team statisticsclient.get_teams()- Get all teamsclient.get_roster(team_code, season)- Get team roster
Schedule Methods
client.get_schedule()- Get current scheduleclient.get_schedule_for_date(date)- Get schedule for specific dateclient.get_schedule_for_date_range(start, end)- Get schedule for date range
🛠️ Development
Setting up Development Environment
# Clone the repository
git clone https://github.com/problemxl/edgework.git
cd edgework
# Install development dependencies
pdm install --dev
# Or using pip
pip install -e .
Running Tests
pytest
Building Documentation
# Install documentation dependencies
pip install mkdocs mkdocs-material mkdocstrings[python] pymdown-extensions
# Build documentation
mkdocs build
# Serve locally
mkdocs serve
📊 Examples
Getting Player Statistics
from edgework import Edgework
client = Edgework()
# Get assists leaders
assist_leaders = client.skater_stats(
season="2023-2024",
sort="assists",
limit=10
)
# Get goalie wins leaders
goalie_wins = client.goalie_stats(
season="2023-2024",
sort="wins",
limit=5
)
Working with Teams
# Get team statistics
team_stats = client.team_stats(season="2023-2024")
# Get team roster
team = team_stats[0] # First team
roster = team.get_roster()
print(f"Roster for {team.name}:")
print(f"Forwards: {len(roster.forwards)}")
print(f"Defensemen: {len(roster.defensemen)}")
print(f"Goalies: {len(roster.goalies)}")
🎯 Season Format
All season parameters should use the format "YYYY-YYYY":
"2023-2024"for the 2023-2024 season"2022-2023"for the 2022-2023 season
🤝 Contributing
Contributions are welcome! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
⚡ API Rate Limiting
Please be respectful of the NHL's servers:
- Implement appropriate delays between requests
- Cache responses when possible
- Handle errors gracefully
🙏 Acknowledgments
- NHL for providing the API data
- Contributors and maintainers
- The Python community
📞 Support
- 📖 Documentation
- 🐛 Issues
- 💬 Discussions
Made with ❤️ for the hockey community
Metadata
Release files for edgework 0.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| edgework-0.11.0.tar.gz | 259.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| edgework-0.11.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 346.6 kB
Release files / edgework-0.11.0.tar.gz
| Download URL | edgework-0.11.0.tar.gz |
|---|---|
| Size | 259.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d97364e965aa7fb94604be28e38c4911f0064d31528de337ae62d48e9079855
|
|
BLAKE2b-256 checksum How to use checksums |
4e7323709fe1aef87641094eb73225a4c4287d7f13d89eacf2b43795f9fe940c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / edgework-0.11.0-py3-none-any.whl
| Download URL | edgework-0.11.0-py3-none-any.whl |
|---|---|
| Size | 87.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d260ad4be21b0ea9120b8a7bc7d0fdfd8626bf1ee5321d9922b0dd62ccfd562
|
|
BLAKE2b-256 checksum How to use checksums |
242e944fe486e3dccb0882cfa3ea133d19a4e62b7922165e2e2dcb7c2013a9ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency log