Skip to main content

anacreonlib

|PyPI Version| |Documentation Status|

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.

.. |PyPI Version| image:: https://img.shields.io/pypi/v/anacreonlib.svg :target: https://pypi.python.org/pypi/anacreonlib

.. |Documentation Status| image:: https://readthedocs.org/projects/anacreonlib/badge/?version=latest :target: http://anacreonlib.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

Metadata

Release files for anacreonlib 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anacreonlib 2.0.1
File Size Uploaded Provenance
anacreonlib-2.0.1.tar.gz 30.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for anacreonlib 2.0.1
File Interpreter ABI Platform
anacreonlib-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 64.8 kB

Release files / anacreonlib-2.0.1.tar.gz

Download URL anacreonlib-2.0.1.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6e940ac16ca20a15b38f5290581ce3fb533d80d2a8fe420548ca7a339a360ea0
BLAKE2b-256 checksum
How to use checksums
520c0a319823d5c3615d99e28784f3335071c5d2ee2de2305fe6827b8a1bfc9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Release files / anacreonlib-2.0.1-py3-none-any.whl

Download URL anacreonlib-2.0.1-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61c2e9433493eada871a472a50efa440b15a4cb50bcbcc7fa74ec3c7ca4be9e5
BLAKE2b-256 checksum
How to use checksums
22f5b1d41b0b3fb1855c3084470fcbe4a1d0c9e01227b4f7cee448d5f8ea55db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Security for anacreonlib 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page