The France Leader API requester.
Project description
Installation
pip install fl-api-requester
Usage
from fl_api_requester import *
connection_data = FLAPIConnectionData()
connection_data.api_uri = "http://localhost:8080"
connection_data.set_credentials("username", "password")
try:
api_requester = FLAPIRequester(connection_data)
# Login
api_requester.login()
# Get some data
player = api_requester.get_player("Galactifer")
alliance = api_requester.get_alliance("France Leader")
print(player)
print(alliance)
print(len(alliance.players))
# Get a War attack
attack = api_requester.get_player_attacks("Galactifer")
print(f"Galactifer attacked on {attack[0].timestamp_to_datetime():%d/%m/%Y at %H:%M:%S}")
except APIErrorException as e:
print(e.api_error)
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file fl-api-requester-1.0.6.tar.gz
.
File metadata
- Download URL: fl-api-requester-1.0.6.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8b15ba322f044dd214c72c1e0ad1974267d0b88503acce56215e31194f87883 |
|
MD5 | 9a696d93b2cacdf06e099d153667afd0 |
|
BLAKE2b-256 | 977b502fb8d1a3acfd78d2725662de2005e722754c39a3c6c4e57bf79f7b1ab9 |
File details
Details for the file fl_api_requester-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: fl_api_requester-1.0.6-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0566af47758921cf77843e92e84a331467fc994da06ed544fbf6ec85f7007c4f |
|
MD5 | 1016eced55c442547c0328e710611318 |
|
BLAKE2b-256 | d208456ebcff754713a24486e99c47fd9a48fb0d16bac53d3d881a52e2f8b87a |