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

Uploaded Source

Built Distribution

fl_api_requester-1.0.8-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fl-api-requester-1.0.8.tar.gz
Algorithm Hash digest
SHA256 e396a5c1748136101d5930be23f989a3ee75ae1016d161cc8c2c84493f5d7f1a
MD5 2af336fdfd37cd92a1ef828b13a181b0
BLAKE2b-256 3805ccd640b0c6ebcc2681c8c4cc1d621550fcbf877fbd18afef02a74b0b03f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fl_api_requester-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 63049294f218290de93da767246e3fa808af2072724d665ee7874fe989425dd1
MD5 024ab3ec5f8ba5329e2ada6d1b5325af
BLAKE2b-256 7b4decb45fdc96a11fa6a7f8581378e78cd3cd643422779ee24470f30690d2a6

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