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.10.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

fl_api_requester-1.0.10-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fl-api-requester-1.0.10.tar.gz
  • Upload date:
  • Size: 9.5 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.10.tar.gz
Algorithm Hash digest
SHA256 98db5c33683fe1b0d7dfb8a6a6c51bb3f5b337383ee95df81ebd5eb9890992fe
MD5 4312742b176f2c30f00337c3fcc48b7b
BLAKE2b-256 1f843ab10c090d96edc02fd74123af2504862772fb460cc1e1a825535fc99806

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fl_api_requester-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 80c227dfa07225a00176f16c6f811deb65956abd1696cdb28acc14ec55bec5fb
MD5 7b4950a277f3cffb0cf60b99ca9c2345
BLAKE2b-256 0d512dd00448cec645b6f84628ff05e8baeca6d7df3d0bfeed06c0f79784e643

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