Git Product home page Git Product logo

dota2api's Introduction

dota2api: wrapper and parser

Join the chat at https://gitter.im/joshuaduffy/dota2api

image

image

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

dota2api's People

Contributors

joshuaduffy avatar evaldobratti avatar gradous avatar anirudhn18 avatar davidfischer avatar bozhko-egor avatar kachebb avatar krrl avatar gitter-badger avatar zhaolin1992 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.