Skip to main content

This library provides a Python interface to the API of Anacreon 3, which is an online 4X game produced by Kronosaur Productions, LLC.

Project description

anacreonlib

This unofficial library provides a Python interface to the API of Anacreon 3, which is an online 4X game produced by Kronosaur Productions, LLC..

Usage

Authentication (version 1.0)

from anacreonlib import Anacreon

api = Anacreon("Username", "Password")
api.gameID = GAME_ID
api.sovID = SOV_ID

You can find GAME_ID by looking at the URL when you play Anacreon in your browser.
For example, when I play on my Era 4 Alpha empire, the url is http://anacreon.kronosaur.com/trantor.hexm?gameID=4365595. Therefore, the game ID for the Era 4 Alpha is 4365595

Your SOV_ID is equal to

api.sovID = api.get_game_info()['userInfo']['sovereignID']

Personally, I run this once and write down the result somewhere

Getting all objects in the game

objects = api.get_objects()

After this call, objects will be a dict, where the key is the ID of the object, and the value is a dict which contains data specific to that object, such as resources contained in the object, which sovereign owns the object, etc. More information can be found on the wiki.

Rate Limits

The API has rate limits which are detailed in this Ministry record. Beware that they apply to both any scripts you write AND the online client.

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

anacreonlib-2.0.0a7.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anacreonlib-2.0.0a7-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file anacreonlib-2.0.0a7.tar.gz.

File metadata

  • Download URL: anacreonlib-2.0.0a7.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.5

File hashes

Hashes for anacreonlib-2.0.0a7.tar.gz
Algorithm Hash digest
SHA256 9494721bde1ad10bafc1f4cebc398415e3c9dbbb440f38a10f8fe3ade120711b
MD5 da34bb7be157546a305bb22bc967816b
BLAKE2b-256 e32ca1b498da124736ea64e6048ac8e9ebe57af6bd892df806186cdf1e0845d7

See more details on using hashes here.

File details

Details for the file anacreonlib-2.0.0a7-py3-none-any.whl.

File metadata

  • Download URL: anacreonlib-2.0.0a7-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.5

File hashes

Hashes for anacreonlib-2.0.0a7-py3-none-any.whl
Algorithm Hash digest
SHA256 79a21811fc0cbb9c2e25738235e894fcc12697303de59486df2ebc123c69f2a6
MD5 7e4afbbff298c3ba38fc621492fb18f7
BLAKE2b-256 369b208f2a83ee2bb52dfa9ea1fd69618930025fda8c13e4c264d4f54a85204e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page