No project description provided
Project description
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
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 edgework-0.3.2.tar.gz.
File metadata
- Download URL: edgework-0.3.2.tar.gz
- Upload date:
- Size: 50.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f0b2028a5cf5e4d26a5cbeae6d79e4bbdfabdb17b0cf3ae1e3e801a513f4b04
|
|
| MD5 |
bb75932520be2bec74e63aab89bce64f
|
|
| BLAKE2b-256 |
db511d6027a5d52a2339182cf418c9ab9200092cabc925376194be4d7d7e1628
|
Provenance
The following attestation bundles were made for edgework-0.3.2.tar.gz:
Publisher:
publish.yml on problemxl/edgework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edgework-0.3.2.tar.gz -
Subject digest:
8f0b2028a5cf5e4d26a5cbeae6d79e4bbdfabdb17b0cf3ae1e3e801a513f4b04 - Sigstore transparency entry: 250594607
- Sigstore integration time:
-
Permalink:
problemxl/edgework@8f31ea33145b6d786d079a3328f0e40e263a2ae2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/problemxl
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8f31ea33145b6d786d079a3328f0e40e263a2ae2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file edgework-0.3.2-py3-none-any.whl.
File metadata
- Download URL: edgework-0.3.2-py3-none-any.whl
- Upload date:
- Size: 45.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5f5178575a76c5b3e8d45300fe3c58c528c78767b5ce9575d6d698a49163706
|
|
| MD5 |
c38e0d880a80220cd13939abd2f4c83f
|
|
| BLAKE2b-256 |
36a13b8848bcee216acf7710ad9c3169ebaafc841edd078e5d052f88341135eb
|
Provenance
The following attestation bundles were made for edgework-0.3.2-py3-none-any.whl:
Publisher:
publish.yml on problemxl/edgework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edgework-0.3.2-py3-none-any.whl -
Subject digest:
e5f5178575a76c5b3e8d45300fe3c58c528c78767b5ce9575d6d698a49163706 - Sigstore transparency entry: 250594618
- Sigstore integration time:
-
Permalink:
problemxl/edgework@8f31ea33145b6d786d079a3328f0e40e263a2ae2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/problemxl
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8f31ea33145b6d786d079a3328f0e40e263a2ae2 -
Trigger Event:
push
-
Statement type: