sleeper-py


Namesleeper-py JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryA Python implementation of the Sleeper API.
upload_time2023-01-13 03:00:30
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2022 Adam Curtis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords sleeper api fantasy football
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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()
~~~
### get_trending_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)
~~~

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "sleeper-py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "Sleeper,API,Fantasy Football",
    "author": "",
    "author_email": "Adam Curtis <adamcurtisvt@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/44/08/50f9f69aeec26b2cf522a27b143830659a0ae57deb16be012c78b369e918/sleeper-py-1.0.0.tar.gz",
    "platform": null,
    "description": "# sleeper-py\nA python implementation of the Sleeper API. Original documentation for these API calls can be found at https://docs.sleeper.app/.\n\n# Install\n~~~\npip install sleeper-py\n~~~\n\n# Usage\n## Avatars\n### get_full_size_avatar()\n~~~\nfrom sleeperpy import Avatars\nAvatars.get_full_size_avatar(avatar_id)\n~~~\n### get_thumbnail_avatar()\n~~~\nfrom sleeperpy import Avatars\nAvatars.get_thumbnail_avatar(avatar_id)\n~~~\n\n## Drafts\n### get_all_drafts_for_user()\n~~~\nfrom sleeperpy import Drafts\nDrafts.get_all_drafts_for_user(user_id, sport, season)\n~~~\n### get_all_drafts_for_league()\n~~~\nfrom sleeperpy import Drafts\nDrafts.get_all_drafts_for_league(league_id)\n~~~\n### get_specific_draft()\n~~~\nfrom sleeperpy import Drafts\nDrafts.get_specific_draft(draft_id)\n~~~\n### get_all_picks_in_draft()\n~~~\nfrom sleeperpy import Drafts\nDrafts.get_all_picks_in_draft(draft_id)\n~~~\n### get_traded_picks_in_draft()\n~~~\nfrom sleeperpy import Drafts\nDrafts.get_traded_picks_in_draft(draft_id)\n~~~\n\n## Leagues\n### get_all_leagues()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_all_leagues(user_id, sport, season)\n~~~\n### get_league()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_league(league_id)\n~~~\n### get_rosters()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_rosters(league_id)\n~~~\n### get_users()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_users(league_id)\n~~~\n### get_matchups()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_matchups(league_id, week)\n~~~\n### get_winners_playoff_bracket()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_winners_playoff_bracket(league_id)\n~~~\n### get_losers_playoff_bracket()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_losers_playoff_bracket(league_id)\n~~~\n### get_transactions()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_transactions(league_id, round)\n~~~\n### get_traded_picks()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_traded_picks(league_id)\n~~~\n### get_state()\n~~~\nfrom sleeperpy import Leagues\nLeagues.get_state(sport)\n~~~\n\n## Players\n### get_all_players()\n~~~\nfrom sleeperpy import Players\nPlayers.get_all_players()\n~~~\n### get_trending_players()\n~~~\nfrom sleeperpy import Players\nPlayers.get_trending_players(sport, type, hours, limit)\n~~~\n\n## User\n### get_user()\n~~~\nfrom sleeperpy import User\nUser.get_user(user_id)\n~~~\n\n# Example\nThis 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.\n~~~\naccount = User.get_user('account_name')\nsport = 'nfl'\nseason = 2022\nweek = 1\n\nleagues = Leagues.get_all_leagues(account['user_id'], sport, season)\nfor league in leagues:\n    league_id = league['league_id']\n    matchups = Leagues.get_matchups(league_id, week)\n~~~\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022 Adam Curtis  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A Python implementation of the Sleeper API.",
    "version": "1.0.0",
    "split_keywords": [
        "sleeper",
        "api",
        "fantasy football"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6f8905b0ced79afd0bdade81a5463f4856d3a2ca85e895041383ce2c09287f23",
                "md5": "e25b5e39887c1090ba966d7177a34319",
                "sha256": "61edaa9374f31ff132594689a38661ae7261f78987f6737960288f778bcce789"
            },
            "downloads": -1,
            "filename": "sleeper_py-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e25b5e39887c1090ba966d7177a34319",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7526,
            "upload_time": "2023-01-13T03:00:29",
            "upload_time_iso_8601": "2023-01-13T03:00:29.596904Z",
            "url": "https://files.pythonhosted.org/packages/6f/89/05b0ced79afd0bdade81a5463f4856d3a2ca85e895041383ce2c09287f23/sleeper_py-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "440850f9f69aeec26b2cf522a27b143830659a0ae57deb16be012c78b369e918",
                "md5": "78a402b85b24a5f4a0df0a07c5e59a77",
                "sha256": "5a24cc5c83b04abdf7a4353bb0089ddd75d676744b2ea1f2456b8b29eed9b529"
            },
            "downloads": -1,
            "filename": "sleeper-py-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "78a402b85b24a5f4a0df0a07c5e59a77",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 5971,
            "upload_time": "2023-01-13T03:00:30",
            "upload_time_iso_8601": "2023-01-13T03:00:30.942296Z",
            "url": "https://files.pythonhosted.org/packages/44/08/50f9f69aeec26b2cf522a27b143830659a0ae57deb16be012c78b369e918/sleeper-py-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-13 03:00:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "sleeper-py"
}
        
Elapsed time: 0.02709s