Fully typed Python API for Goodgame Empire
Project description
EmpireCore
Fully typed Python API for Goodgame Empire
Features • Installation • Quick Start • Roadmap
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 chatMapScanner- World map scanningResourceManager,BuildingManager,UnitManager- AutomationDefenseManager,QuestService,BattleReportService- Game automationEventManager- Async event system
For educational purposes only. Use responsibly.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aaf17ef28ee0cfa534ceed01bfbd4ae936693527182b4438a21821075c23a7d0
|
|
| MD5 |
01cf704db5281637881eeb9171a2eebb
|
|
| BLAKE2b-256 |
395c55ae9e79d086e1a329696e26012187054bcbb17bb55dab692c4b306b0b16
|
Provenance
The following attestation bundles were made for empire_core-0.2.1.tar.gz:
Publisher:
publish.yml on eschnitzler/EmpireCore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
empire_core-0.2.1.tar.gz -
Subject digest:
aaf17ef28ee0cfa534ceed01bfbd4ae936693527182b4438a21821075c23a7d0 - Sigstore transparency entry: 790069915
- Sigstore integration time:
-
Permalink:
eschnitzler/EmpireCore@2ba8b8cce5f51f8939831c2eb393c3ce56a19528 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/eschnitzler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ba8b8cce5f51f8939831c2eb393c3ce56a19528 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30599a813d3817e422f8ac43f2c0a7b4efc34a3b0ba400dfa0579a4cfef74a4b
|
|
| MD5 |
0ea8303ed75e4fbcd1d81c89c24281cc
|
|
| BLAKE2b-256 |
331729135f3cd3c51f28ba93e11ca7b3ea68219c003a1e933b16948573f54307
|
Provenance
The following attestation bundles were made for empire_core-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on eschnitzler/EmpireCore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
empire_core-0.2.1-py3-none-any.whl -
Subject digest:
30599a813d3817e422f8ac43f2c0a7b4efc34a3b0ba400dfa0579a4cfef74a4b - Sigstore transparency entry: 790069918
- Sigstore integration time:
-
Permalink:
eschnitzler/EmpireCore@2ba8b8cce5f51f8939831c2eb393c3ce56a19528 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/eschnitzler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ba8b8cce5f51f8939831c2eb393c3ce56a19528 -
Trigger Event:
workflow_dispatch
-
Statement type: