Skip to main content

sleeper-py

A python implementation of the Sleeper API. Original documentation for these API calls can be found at https://docs.sleeper.app/.

Install

pip install sleeper-py

Usage

Avatars

get_full_size_avatar()

from sleeperpy import Avatars
Avatars.get_full_size_avatar(avatar_id)

get_thumbnail_avatar()

from sleeperpy import Avatars
Avatars.get_thumbnail_avatar(avatar_id)

Drafts

get_all_drafts_for_user()

from sleeperpy import Drafts
Drafts.get_all_drafts_for_user(user_id, sport, season)

get_all_drafts_for_league()

from sleeperpy import Drafts
Drafts.get_all_drafts_for_league(league_id)

get_specific_draft()

from sleeperpy import Drafts
Drafts.get_specific_draft(draft_id)

get_all_picks_in_draft()

from sleeperpy import Drafts
Drafts.get_all_picks_in_draft(draft_id)

get_traded_picks_in_draft()

from sleeperpy import Drafts
Drafts.get_traded_picks_in_draft(draft_id)

Leagues

get_all_leagues()

from sleeperpy import Leagues
Leagues.get_all_leagues(user_id, sport, season)

get_league()

from sleeperpy import Leagues
Leagues.get_league(league_id)

get_rosters()

from sleeperpy import Leagues
Leagues.get_rosters(league_id)

get_users()

from sleeperpy import Leagues
Leagues.get_users(league_id)

get_matchups()

from sleeperpy import Leagues
Leagues.get_matchups(league_id, week)

get_winners_playoff_bracket()

from sleeperpy import Leagues
Leagues.get_winners_playoff_bracket(league_id)

get_losers_playoff_bracket()

from sleeperpy import Leagues
Leagues.get_losers_playoff_bracket(league_id)

get_transactions()

from sleeperpy import Leagues
Leagues.get_transactions(league_id, round)

get_traded_picks()

from sleeperpy import Leagues
Leagues.get_traded_picks(league_id)

get_state()

from sleeperpy import Leagues
Leagues.get_state(sport)

Players

get_all_players()

from sleeperpy import Players
Players.get_all_players()
from sleeperpy import Players
Players.get_trending_players(sport, type, hours, limit)

User

get_user()

from sleeperpy import User
User.get_user(user_id)

Example

This example shows how to retrieve a user ID and use it to query for leagues and matchups for week 1 of the 2022 NFL season.

account = User.get_user('account_name')
sport = 'nfl'
season = 2022
week = 1

leagues = Leagues.get_all_leagues(account['user_id'], sport, season)
for league in leagues:
    league_id = league['league_id']
    matchups = Leagues.get_matchups(league_id, week)

Metadata

Release files for sleeper-py 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sleeper-py 1.0.1
File Size Uploaded Provenance Actions
sleeper-py-1.0.1.tar.gz 6.0 kB Without provenance Details for sleeper-py-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sleeper-py 1.0.1
File Interpreter ABI Platform Actions
sleeper_py-1.0.1-py3-none-any.whl Python 3 none any Details for sleeper_py-1.0.1-py3-none-any.whl

Total release size: 13.5 kB

Release files / sleeper-py-1.0.1.tar.gz

Download URL sleeper-py-1.0.1.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8ffdb13072b545ae8b7b2a48b05f52686a248741e03e7a18dd76dd027d492563
BLAKE2b-256 checksum
How to use checksums
6ece954fcb81ef1834192f47366f9b78f00aaac2c505935d7d4dd49ca2c8a0bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / sleeper_py-1.0.1-py3-none-any.whl

Download URL sleeper_py-1.0.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf3d1b85c810d5730ddbc8675a0be11ad45a06e97a7243ae1b7707ac8d9fbd63
BLAKE2b-256 checksum
How to use checksums
380da1db9dac4b4e23b31412514deec0bcb8af055af2ca188665443e34c03cbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for sleeper-py 1.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page