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
.
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
Built Distribution
Hashes for aoe2netapi_wrapper-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63dca59dd2d22ddff67fb08deed15f62c0fdc21f4b64fdd5ec440290b848e9ed |
|
MD5 | 411577d66e1fc2e85273b9ee6a410552 |
|
BLAKE2b-256 | 392cadd25d4913e026c195d4b0767649415251652bf3ff5a77a2d8052c8cb487 |