This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Dota 2 API wrapper and parser in Python

Project Description

Wrapper and parser in Python created for interacting and getting data easily from Valve’s Dota 2 API. It supports Python versions 2.6 to 2.7+, 3.2 to 3.5+ along with PyPy/PyPy3

This library parses some ID’s into the dictionary keys like hero_name and so on. See src.parse for details.

This also comes with a growing set of tests and some documentation for the API itself.

Look how easy it is…

>>> import dota2api
>>> api = dota2api.Initialise("API_KEY")
>>> hist = api.get_match_history(account_id=41231571)
>>> match = api.get_match_details(match_id=1000193456)
>>> match['radiant_win']
False

You can even store your API key as an environment variable instead of passing it through Initialise() to save some finger work.

$  export D2_API_KEY=83247983248793298732

Install

Install via pip…

$ pip install dota2api

Or the old fashioned way…

$ git clone https://github.com/joshuaduffy/dota2api.git
$ cd dota2api
$ python setup.py install

Documentation

Documentation is available at http://dota2api.readthedocs.org/

Supported API calls

  • get_match_history
  • get_match_history_by_seq_num
  • get_match_details
  • get_player_summaries
  • get_league_listing
  • get_live_league_games
  • get_team_info_by_team_id
  • get_heroes
  • get_tournament_prize_pool
  • get_game_items
  • get_top_live_games

Unsupported

  • EconomySchema

Run the tests

Using nose and nose-cov:

$ nosetests --with-cov --cov-report html dota2api tests

To install them do the following:

$ pip install nose nose-cov
Release History

Release History

This version
History Node

1.3.3

History Node

1.3.2

History Node

1.3.1

History Node

1.2.9

History Node

1.2.8

History Node

1.2.7

History Node

1.2.6.2

History Node

1.2.6.1

History Node

1.2.6

History Node

1.2.5

History Node

1.2.4

History Node

1.2.3

History Node

1.2.2

History Node

1.2.1

History Node

0.9.2

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dota2api-1.3.3.zip (36.6 kB) Copy SHA256 Checksum SHA256 Source Mar 6, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting