Skip to main content

Fully typed Python API for Goodgame Empire

Project description

Python 3.10+ Pydantic v2 UV Work in Progress

EmpireCore

Fully typed Python API for Goodgame Empire

FeaturesInstallationQuick StartRoadmap


Warning: Work in Progress

This library is under active development. APIs may change, and some features are incomplete or untested.


Features

Category Capabilities
Connection WebSocket with threading, auto-reconnect, keepalive, login cooldown handling
State Tracking Player, castles, resources, movements
Protocol Packet parsing (XML handshake, XT/JSON game data)
Models Pydantic models for type-safe game data

Installation

This project uses uv for dependency management.

git clone https://github.com/eschnitzler/EmpireCore.git
cd EmpireCore
uv sync

Quick Start

from empire_core import EmpireClient

client = EmpireClient(username="your_user", password="your_pass")
client.login()

movements = client.get_movements()
print(f"Found {len(movements)} movements")

for m in client.get_incoming_attacks():
    print(f"Incoming attack! {m.time_remaining}s remaining")

client.close()

Roadmap

Done

  • Sync Connection - WebSocket with websocket-client, receive thread, keepalive thread
  • Message Routing - Waiters (request/response) and Subscribers (pub/sub for events)
  • EmpireClient - Login sequence, basic commands (get_movements, send_alliance_chat)
  • Packet Protocol - XML and XT packet parsing
  • State Models - Player, Castle, Movement, MapObject with Pydantic

In Progress

  • Alliance Chat Detection - Identify incoming chat packet command ID
  • State Manager Sync - Port GameState from async to sync

Planned

  • More Commands - search_alliance, get_alliance_members, attack, transport, etc.
  • AccountPool - Manage multiple accounts for parallel operations
  • Dreambot Integration - Use from Discord.py via thread pool

Archived (for later)

The following async services are archived in _archive/ for future porting as needed:

  • AllianceService, ChatService - Alliance management and chat
  • MapScanner - World map scanning
  • ResourceManager, BuildingManager, UnitManager - Automation
  • DefenseManager, QuestService, BattleReportService - Game automation
  • EventManager - Async event system

For educational purposes only. Use responsibly.

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

empire_core-0.2.1.tar.gz (242.5 kB view details)

Uploaded Source

Built Distribution

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

empire_core-0.2.1-py3-none-any.whl (84.6 kB view details)

Uploaded Python 3

File details

Details for the file empire_core-0.2.1.tar.gz.

File metadata

  • Download URL: empire_core-0.2.1.tar.gz
  • Upload date:
  • Size: 242.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for empire_core-0.2.1.tar.gz
Algorithm Hash digest
SHA256 aaf17ef28ee0cfa534ceed01bfbd4ae936693527182b4438a21821075c23a7d0
MD5 01cf704db5281637881eeb9171a2eebb
BLAKE2b-256 395c55ae9e79d086e1a329696e26012187054bcbb17bb55dab692c4b306b0b16

See more details on using hashes here.

Provenance

The following attestation bundles were made for empire_core-0.2.1.tar.gz:

Publisher: publish.yml on eschnitzler/EmpireCore

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

File details

Details for the file empire_core-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: empire_core-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 84.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for empire_core-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30599a813d3817e422f8ac43f2c0a7b4efc34a3b0ba400dfa0579a4cfef74a4b
MD5 0ea8303ed75e4fbcd1d81c89c24281cc
BLAKE2b-256 331729135f3cd3c51f28ba93e11ca7b3ea68219c003a1e933b16948573f54307

See more details on using hashes here.

Provenance

The following attestation bundles were made for empire_core-0.2.1-py3-none-any.whl:

Publisher: publish.yml on eschnitzler/EmpireCore

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