Skip to main content

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 list
  • client.skater_stats(season, ...) - Get skater statistics
  • client.goalie_stats(season, ...) - Get goalie statistics

Team Methods

  • client.team_stats(season, ...) - Get team statistics
  • client.get_teams() - Get all teams
  • client.get_roster(team_code, season) - Get team roster

Schedule Methods

  • client.get_schedule() - Get current schedule
  • client.get_schedule_for_date(date) - Get schedule for specific date
  • client.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.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. 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


Made with ❤️ for the hockey community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edgework-0.4.5.tar.gz (147.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edgework-0.4.5-py3-none-any.whl (48.0 kB view details)

Uploaded Python 3

File details

Details for the file edgework-0.4.5.tar.gz.

File metadata

  • Download URL: edgework-0.4.5.tar.gz
  • Upload date:
  • Size: 147.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for edgework-0.4.5.tar.gz
Algorithm Hash digest
SHA256 02f4d7361cfc687609b4bae5acfb82beb3d0355c80c73911f27e5c203f3854ee
MD5 6ba2feeb47ab9a68827e6dc8e98476be
BLAKE2b-256 84143f5940e0ca81fb105b437baedc7c7413819cd011d70f12b06e974eb09626

See more details on using hashes here.

Provenance

The following attestation bundles were made for edgework-0.4.5.tar.gz:

Publisher: publish.yml on problemxl/edgework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file edgework-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: edgework-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 48.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for edgework-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ea2bafc6838d161d044c43e1b69d85b99c6b4c88e006df2915579836b5e0f8c9
MD5 4ca482aaffc848220869cdb6ba4c24dc
BLAKE2b-256 a29231b4a7f7dc9b4ffc94eed9fb7c281afccb6651378ebf82cfc031a86b6d3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for edgework-0.4.5-py3-none-any.whl:

Publisher: publish.yml on problemxl/edgework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page