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.

This wrapper solely supports requesting the data from the aoe2.net API. Further data manipulation/extraction required from the requested data has to be done by you, the user.

Requirements:

  • requests >= 2.20.0
  • Python 3.X required

Installation

Available on PyPi

pip install aoe2netapi-wrapper

Example usage

up to and including v0.3.0:

import aoe2netapi as aoe

leaderboard = aoe.ab_get_leaderboard(leaderboard_id=3, search="TheViper")
print(leaderboard)

rank_details = aoe.nb_get_rank_details(search="TheViper", leaderboard_id=3)
print(rank_details)

# ...

v1.0.0 and onwards (see issue #1 and the changelog) there are two different ways, which lead to the same outcome:

1.) importing the usual way

import aoe2netapi as aoe

api = aoe.API()
leaderboard = api.get_leaderboard(leaderboard_id=3, search="TheViper")
print(leaderboard)

nightbot = aoe.Nightbot()
rank_details = nightbot.get_rank_details(search="TheViper", leaderboard_id=3)
print(rank_details)

# ...

2.) via their respective classes

from aoe2netapi import API, Nightbot

api = API()
leaderboard = api.get_leaderboard(leaderboard_id=3, search="TheViper")
print(leaderboard)

nightbot = Nightbot()
rank_details = nightbot.get_rank_details(search="TheViper", leaderboard_id=3)
print(rank_details)

# or simply via 'chaining', like this
# leaderboard = API().get_leaderboard(leaderboard_id=3, search="TheViper")

# ...

Documentation

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

For the documentation for up to and including v0.3.0, see the documentation page here: documentation page

Changelog

See the changelog here on GitHub: changelog page.

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-1.0.0.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

aoe2netapi_wrapper-1.0.0-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

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