OpenDota API
Project description
python-opendota
Generated Python SDK for working with OpenDota API.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 18.0.0
- Package version: 1.0.1
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python >=3.6
Installation & Usage
pip install
You can install directly using:
pip install git+https://github.com/swimmwatch/python-opendota.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/swimmwatch/python-opendota.git
)
or:
pip install python-opendota
Then import the package:
import python_opendota
Poetry
Install via Poetry.
poetry add python-opendota
Then import the package:
import python_opendota
Getting Started
Please follow the installation procedure and then run the following:
import time
import python_opendota
from pprint import pprint
from python_opendota.api import benchmarks_api
from python_opendota.model.benchmarks_response import BenchmarksResponse
# Defining the host is optional and defaults to http://api.opendota.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = python_opendota.Configuration(
host = "http://api.opendota.com/api"
)
# Enter a context with an instance of the API client
with python_opendota.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = benchmarks_api.BenchmarksApi(api_client)
hero_id = "hero_id_example" # str | Hero ID
try:
# GET /benchmarks
api_response = api_instance.benchmarks_get(hero_id)
pprint(api_response)
except python_opendota.ApiException as e:
print("Exception when calling BenchmarksApi->benchmarks_get: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://api.opendota.com/api
Class | Method | HTTP request | Description |
---|---|---|---|
BenchmarksApi | benchmarks_get | GET /benchmarks | GET /benchmarks |
ConstantsApi | constants_get | GET /constants | GET /constants |
ConstantsApi | constants_resource_get | GET /constants/{resource} | GET /constants |
DistributionsApi | distributions_get | GET /distributions | GET /distributions |
ExplorerApi | explorer_get | GET /explorer | GET /explorer |
FindMatchesApi | find_matches_get | GET /findMatches | GET / |
HealthApi | health_get | GET /health | GET /health |
HeroStatsApi | hero_stats_get | GET /heroStats | GET /heroStats |
HeroesApi | heroes_get | GET /heroes | GET /heroes |
HeroesApi | heroes_hero_id_durations_get | GET /heroes/{hero_id}/durations | GET /heroes/{hero_id}/durations |
HeroesApi | heroes_hero_id_item_popularity_get | GET /heroes/{hero_id}/itemPopularity | GET /heroes/{hero_id}/itemPopularity |
HeroesApi | heroes_hero_id_matches_get | GET /heroes/{hero_id}/matches | GET /heroes/{hero_id}/matches |
HeroesApi | heroes_hero_id_matchups_get | GET /heroes/{hero_id}/matchups | GET /heroes/{hero_id}/matchups |
HeroesApi | heroes_hero_id_players_get | GET /heroes/{hero_id}/players | GET /heroes/{hero_id}/players |
LeaguesApi | leagues_get | GET /leagues | GET /leagues |
LeaguesApi | leagues_league_id_get | GET /leagues/{league_id} | GET /leagues/{league_id} |
LeaguesApi | leagues_league_id_matches_get | GET /leagues/{league_id}/matches | GET /leagues/{league_id}/matches |
LeaguesApi | leagues_league_id_teams_get | GET /leagues/{league_id}/teams | GET /leagues/{league_id}/teams |
LiveApi | live_get | GET /live | GET /live |
MatchesApi | matches_match_id_get | GET /matches/{match_id} | GET /matches/{match_id} |
MetadataApi | metadata_get | GET /metadata | GET /metadata |
ParsedMatchesApi | parsed_matches_get | GET /parsedMatches | GET /parsedMatches |
PlayersApi | players_account_id_counts_get | GET /players/{account_id}/counts | GET /players/{account_id}/counts |
PlayersApi | players_account_id_get | GET /players/{account_id} | GET /players/{account_id} |
PlayersApi | players_account_id_heroes_get | GET /players/{account_id}/heroes | GET /players/{account_id}/heroes |
PlayersApi | players_account_id_histograms_field_get | GET /players/{account_id}/histograms/{field} | GET /players/{account_id}/histograms |
PlayersApi | players_account_id_matches_get | GET /players/{account_id}/matches | GET /players/{account_id}/matches |
PlayersApi | players_account_id_peers_get | GET /players/{account_id}/peers | GET /players/{account_id}/peers |
PlayersApi | players_account_id_pros_get | GET /players/{account_id}/pros | GET /players/{account_id}/pros |
PlayersApi | players_account_id_rankings_get | GET /players/{account_id}/rankings | GET /players/{account_id}/rankings |
PlayersApi | players_account_id_ratings_get | GET /players/{account_id}/ratings | GET /players/{account_id}/ratings |
PlayersApi | players_account_id_recent_matches_get | GET /players/{account_id}/recentMatches | GET /players/{account_id}/recentMatches |
PlayersApi | players_account_id_refresh_post | POST /players/{account_id}/refresh | POST /players/{account_id}/refresh |
PlayersApi | players_account_id_totals_get | GET /players/{account_id}/totals | GET /players/{account_id}/totals |
PlayersApi | players_account_id_wardmap_get | GET /players/{account_id}/wardmap | GET /players/{account_id}/wardmap |
PlayersApi | players_account_id_wl_get | GET /players/{account_id}/wl | GET /players/{account_id}/wl |
PlayersApi | players_account_id_wordcloud_get | GET /players/{account_id}/wordcloud | GET /players/{account_id}/wordcloud |
PlayersByRankApi | players_by_rank_get | GET /playersByRank | GET /playersByRank |
ProMatchesApi | pro_matches_get | GET /proMatches | GET /proMatches |
ProPlayersApi | pro_players_get | GET /proPlayers | GET /proPlayers |
PublicMatchesApi | public_matches_get | GET /publicMatches | GET /publicMatches |
RankingsApi | rankings_get | GET /rankings | GET /rankings |
RecordsApi | records_field_get | GET /records/{field} | GET /records/{field} |
ReplaysApi | replays_get | GET /replays | GET /replays |
RequestApi | request_job_id_get | GET /request/{jobId} | GET /request/{jobId} |
RequestApi | request_match_id_post | POST /request/{match_id} | POST /request/{match_id} |
ScenariosApi | scenarios_item_timings_get | GET /scenarios/itemTimings | GET /scenarios/itemTimings |
ScenariosApi | scenarios_lane_roles_get | GET /scenarios/laneRoles | GET /scenarios/laneRoles |
ScenariosApi | scenarios_misc_get | GET /scenarios/misc | GET /scenarios/misc |
SchemaApi | schema_get | GET /schema | GET /schema |
SearchApi | search_get | GET /search | GET /search |
StatusApi | status_get | GET /status | GET /status |
TeamsApi | teams_get | GET /teams | GET /teams |
TeamsApi | teams_team_id_get | GET /teams/{team_id} | GET /teams/{team_id} |
TeamsApi | teams_team_id_heroes_get | GET /teams/{team_id}/heroes | GET /teams/{team_id}/heroes |
TeamsApi | teams_team_id_matches_get | GET /teams/{team_id}/matches | GET /teams/{team_id}/matches |
TeamsApi | teams_team_id_players_get | GET /teams/{team_id}/players | GET /teams/{team_id}/players |
Documentation For Models
- BenchmarksResponse
- BenchmarksResponseResult
- BenchmarksResponseResultGoldPerMin
- DistributionsResponse
- DistributionsResponseCountryMmr
- DistributionsResponseCountryMmrFields
- DistributionsResponseCountryMmrRows
- DistributionsResponseMmr
- DistributionsResponseRanks
- DistributionsResponseRanksFields
- DistributionsResponseRanksRows
- DistributionsResponseRanksSum
- HeroDurationsResponse
- HeroItemPopularityResponse
- HeroItemPopularityResponseEarlyGameItems
- HeroItemPopularityResponseLateGameItems
- HeroItemPopularityResponseMidGameItems
- HeroItemPopularityResponseStartGameItems
- HeroMatchupsResponse
- HeroObjectResponse
- HeroStatsResponse
- LeagueObjectResponse
- MatchObjectResponse
- MatchResponse
- MatchResponseBuybackLog
- MatchResponseChat
- MatchResponseConnectionLog
- MatchResponseDraftTimings
- MatchResponseKillsLog
- MatchResponsePlayers
- MatchResponsePurchaseLog
- MatchResponseRunesLog
- MetadataResponse
- MetadataResponseCheese
- ParsedMatchesResponse
- PlayerCountsResponse
- PlayerHeroesResponse
- PlayerMatchesResponse
- PlayerObjectResponse
- PlayerPeersResponse
- PlayerProsResponse
- PlayerRankingsResponse
- PlayerRatingsResponse
- PlayerRecentMatchesResponse
- PlayerResponse
- PlayerResponseMmrEstimate
- PlayerResponseProfile
- PlayerTotalsResponse
- PlayerWardMapResponse
- PlayerWinLossResponse
- PlayerWordCloudResponse
- PlayersByRankResponse
- PublicMatchesResponse
- RankingsResponse
- RankingsResponseRankings
- RecordsResponse
- ReplaysResponse
- ScenarioItemTimingsResponse
- ScenarioLaneRolesResponse
- ScenarioMiscResponse
- SchemaResponse
- SearchResponse
- TeamHeroesResponse
- TeamObjectResponse
- TeamPlayersResponse
Documentation For Authorization
api_key
- Type: API key
- API key parameter name: api_key
- Location: URL query string
Author
Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in python_opendota.apis and python_opendota.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
Solution 1: Use specific imports for apis and models like:
from python_opendota.api.default_api import DefaultApi
from python_opendota.model.pet import Pet
Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:
import sys
sys.setrecursionlimit(1500)
import python_opendota
from python_opendota.apis import *
from python_opendota.models import *
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
Built Distribution
Hashes for python_opendota-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f05737cf141618999d3c647796e318b4484e9947a21020f65e4436a3c12f825 |
|
MD5 | d4e291e50d2fd714c038b39afd7bded7 |
|
BLAKE2b-256 | db143df10b89dfd916fb4f6930800b4ffe1c940a067a158a673124fd8df8f93b |