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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fl-api-requester-1.0.5.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

Hashes for fl-api-requester-1.0.5.tar.gz
Algorithm Hash digest
SHA256 57d4ab1139e168377b46a063661d2fd14df5aae13afdafad1d67c6e3fa47bb68
MD5 08ed7cd2d42f6e5998ad9488340ed848
BLAKE2b-256 b7214e02f62eed42b2b6ac5754ae6aa184a1a54a646f2b9c40bbe7c335ec4067

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fl_api_requester-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b398b71ea7d1787e6ae999f43a27f20d56f148603eff29d5702c31f11103d184
MD5 f85a61418bfd72fa1bf93db8c1d2966e
BLAKE2b-256 a1e330f8f12d485d45347416968349ce68c4503201b44f54dcdee85690e04750

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