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 <https://anacreon.kronosaur.com>
, which is an online
4X <https://en.wikipedia.org/wiki/4X>
game produced by
Kronosaur Productions, LLC. <http://kronosaur.com/>
_.
The minimum supported Python version is 3.8
Make sure to read the "Scripts and Bots" section of the
Kronosaur Terms of Service <https://multiverse.kronosaur.com/news.hexm?id=97#:~:text=scripts%20and%20bots>
_.
Installation
anacreonlib
can be installed using pip::
$ pip install anacreonlib
Usage
Below is a minimum working example to get started with using the Anacreon API
.. code-block:: python
from anacreonlib import Anacreon, Fleet
import asyncio
async def main():
## Step 1: Log in
client: Anacreon = await Anacreon.log_in(
game_id="8JNJ7FNZ",
username="username",
password="password"
)
## Step 2: do cool stuff, automatically!
# find all of our fleets
all_my_fleets = [
fleet
for fleet in client.space_objects.values()
if isinstance(fleet, Fleet)
and fleet.sovereign_id == client.sov_id
]
# send all our fleets to world ID 100
for fleet in all_my_fleets:
await client.set_fleet_destination(fleet.id, 100)
if __name__ == "__main__":
asyncio.run(main())
Rate Limits
The API has rate limits which are detailed in
this Ministry record <https://ministry.kronosaur.com/record.hexm?id=79981>
_.
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.0a14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0682721c3a5085b6fce7293a46fdec15c7161f13eb485a1c1a1ea5f1acce26de |
|
MD5 | 772fa5a106727edb944163f50db1a7b2 |
|
BLAKE2b-256 | ed8e8ba7d0668779b43f3364d01044cd194192672bdb038722024b3658f689db |