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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for anacreonlib-2.0.0a8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1b7381df494308a4419e82a8130114973f272c4c246cdd965c0316342959350 |
|
MD5 | 0302e3086e8cd6958c33c0efe9d6f608 |
|
BLAKE2b-256 | fdbf8f76ab725d138ab8e754fccafec666a4964861383cbbfa28aa70470bc18e |