Skip to main content

Async client for Satisfactory dedicated server APIs

Project description

aiosatisfactory

This is an async Python library for Satisfactory dedicated server's APIs.

This work is based off the official documentation that is provided with the game files or is also available on the official wiki

Lightweight API (docs)

This API should be used to poll the server state before making most of the https requests
No errors are raised but you must check if the query was succesful

Usage:

from aiosatisfactory import SatisfactoryServer
import asyncio, time

async def main():
    server = SatisfactoryServer("server.ip")
    query = await server.lightweight.query(time.time_ns())
    print(query.response.SubStates)

asyncio.run(main())

Https API (docs)

This API requires the session parameter to be set in the SatisfactoryServer constructor
It does raise an ErrorResponse exeption if the function you try to execute fails

Usage:

import asyncio, aiohttp
from aiosatisfactory import SatisfactoryServer
from aiosatisfactory.https.models import ErrorResponse

async def main():
    async with aiohttp.ClientSession() as session:
        client = SatisfactoryServer("server.ip", session=session)
        try:
            response = await client.https.api.health_check()
            print(response.health)
        except ErrorResponse as e:
            print(f"Error: {e.error_code, e.error_message, e.error_details}")

asyncio.run(main())

Mappings

The Https API provides the value of active_schematic and game_phase as some internal strings, this class provides translations to the proper display names

Usage:

import asyncio, aiohttp
from aiosatisfactory import SatisfactoryServer
from aiosatisfactory.https.models import ErrorResponse

async def main():
    async with aiohttp.ClientSession() as session:
        client = SatisfactoryServer("server.ip", session=session, api_token="your_api_token")
        try:
            response = await client.https.api.query_server_state()
            print(client.mappings.game_phase(response.game_phase))
            print(client.mappings.schematic(response.active_schematic))
        except ErrorResponse as e:
            print(f"Error: {e.error_code, e.error_message, e.error_details}")

asyncio.run(main())

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

aiosatisfactory-0.1.6.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

aiosatisfactory-0.1.6-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file aiosatisfactory-0.1.6.tar.gz.

File metadata

  • Download URL: aiosatisfactory-0.1.6.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aiosatisfactory-0.1.6.tar.gz
Algorithm Hash digest
SHA256 8f2ceef23328f99a236d825285318334e8590c6bc3c49c5627c36dc1e5ef872a
MD5 65d741cc05a68a592eb32b14183bb536
BLAKE2b-256 3386dc8b87a2632e5159aba4a9a0b55cc8437ca7a614467488f1cb3b313c5f00

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosatisfactory-0.1.6.tar.gz:

Publisher: python-publish.yml on Rikys/aiosatisfactory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiosatisfactory-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: aiosatisfactory-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aiosatisfactory-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 950ca4a41d23e10c6e96876edec95d494dcbb56eeb1d87f3cf0b307c83be95ec
MD5 682131b5dcd076034509a4c58efc0762
BLAKE2b-256 adc42c5e3dfd4d0aec03010649205fe50d3caced4e227be03eccdaa338475351

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiosatisfactory-0.1.6-py3-none-any.whl:

Publisher: python-publish.yml on Rikys/aiosatisfactory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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