Skip to main content

A simple and basic Python 3 API wrapper for the https://aoe2.net/#api API.

Project description

aoe2net-api-wrapper

A simple and basic Python 3 https://aoe2.net/ API wrapper for sending GET requests.

GitHub release (latest by date) PyPI PyPI - Downloads Downloads PyPI - Python Version

See the documentation of the API wrapper here on GitHub: section 'Documentation'.

See https://aoe2.net/#api and https://aoe2.net/#nightbot for the aoe2.net API (documentation) directly.

Requirements:

  • requests >= 2.20.0
  • dataclasses-json == 0.5.7
  • Python 3.7+ required

Installation

Available on PyPi

pip install aoe2netapi-wrapper

Example usage

from aoe2netapi import API, Nightbot
from aoe2netapi.constants import LeaderboardId, EventLeaderboardId
from aoe2netapi.models import Leaderboard

# API class
api = API()
leaderboard: Leaderboard = api.get_leaderboard(leaderboard_id=LeaderboardId.AOE_TWO_RM, count=100)
print(leaderboard)
# Leaderboard<total = 43055, leaderboard_id = 3, start = 1, count = 100, players = [...],
#             game="aoe2de", is_event_leaderboard=False

for player in leaderboard.players:  # player is of type 'LeaderboardPlayer'
  print(player.rank, player.name, player.rating, player.highest_rating, ...)

# Nighbot class
nightbot = Nightbot()
rating_history: str = nightbot.get_current_or_last_match(leaderboard_id=LeaderboardId.AOE_TWO_RM, search="GL.TheViper")
print(rating_history)
# GL.TheViper (2688) Rank #4, has played 1,542 games with a 65% winrate, -1 streak, and 4 drops

Documentation

See the documentation on the provided functions here on GitHub: documentation page.

For the documentation for previous versions, see the documentation page here: documentation page.

Changelog

See the changelog here on GitHub: changelog page.

License

MIT License. See LICENSE.

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

aoe2netapi-wrapper-2.0.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

aoe2netapi_wrapper-2.0.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file aoe2netapi-wrapper-2.0.0.tar.gz.

File metadata

  • Download URL: aoe2netapi-wrapper-2.0.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for aoe2netapi-wrapper-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d4a5ba0038aa70bc3f4c96a683702f62937f66e03e27428498f6583db2fb6c85
MD5 35651782a089a094596f1afb06b4d954
BLAKE2b-256 315dfe988ffd4d724128da04aa4d700c4922314e53d6abe2dbb93657f948865a

See more details on using hashes here.

File details

Details for the file aoe2netapi_wrapper-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: aoe2netapi_wrapper-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for aoe2netapi_wrapper-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d6abccc2414dfde4a50298aaf0c302c7b35a672ab439b80841093603c26ca80
MD5 a17201b4f9ca88dc95c3deda82d80543
BLAKE2b-256 262c9449b16404b9dd99c56c637424dddb282e59a4d68608a01e80dd53048185

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page