Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fl-api-requester-1.0.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

fl_api_requester-1.0.2-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file fl-api-requester-1.0.2.tar.gz.

File metadata

  • Download URL: fl-api-requester-1.0.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for fl-api-requester-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e7a6e29a20772100968299329fa84ded98788cd368ac847c188f8f59587a9e8e
MD5 b6b28fbdb1e2abc40347d91d3ae7f752
BLAKE2b-256 e8d6e6e792863502df0e00afc2acac26415563b969b3f8c0feac4d24307d654b

See more details on using hashes here.

File details

Details for the file fl_api_requester-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fl_api_requester-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1ac7075333f80098d1194853231ca45f3d73f4c9cf44b14dda1a30b87cf79579
MD5 f1fa86c3c0159981ab2a60d4417c6f35
BLAKE2b-256 263550ce4f52b2436a06a2017f18b253fd2d58fb4619e64b33fec3b7ae4381f1

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