Asynchronous Python framework for Goodgame Empire
Project description
EmpireCore
Modern async Python library for Goodgame Empire automation
Features • Installation • Quick Start • Examples • Documentation
⚠️ Work in Progress
This library is under active development. APIs may change, and some features are incomplete or untested. Use at your own risk.
Features
| Category | Capabilities |
|---|---|
| Connection | WebSocket, auto-reconnect, login cooldown handling |
| State Tracking | Player, castles, resources, buildings, units, movements |
| Actions | Attacks, transports, recruiting, building, with response validation |
| Automation | Task loops, multi-account, target finder, map scanner |
| CLI | Account status, login testing, state summary |
Installation
This project uses uv for blazing-fast dependency management.
git clone https://github.com/eschnitzler/EmpireCore.git
cd EmpireCore
# Install dependencies and create venv automatically
uv sync
Traditional Installation (Pip)
python3 -m venv .venv
source .venv/bin/activate
pip install .
Configuration
Create an accounts.json file in the root directory. You can use the provided template:
cp accounts.json.template accounts.json
Then edit accounts.json with your credentials. This file is git-ignored to keep your credentials safe.
Quick Start
import asyncio
from empire_core import accounts
async def main():
# Load default account from accounts.json
account = accounts.get_default()
if not account:
print("Please configure accounts.json first!")
return
# Create client directly from account object
client = account.get_client()
await client.login()
await client.get_detailed_castle_info()
player = client.state.local_player
print(f"{player.name} | Level {player.level} | {player.gold} gold")
await client.close()
asyncio.run(main())
CLI Tool
The library includes a CLI for quick operations:
# Check configured accounts
uv run empire status
# Test login and show player stats
uv run empire login
Running Examples & Tests
# Run the demo
uv run examples/demo.py
# Run unit tests
uv run pytest
Development
We use ruff for linting and mypy for type checking.
# Setup pre-commit hooks
uv run pre-commit install
# Run all checks manually
uv run pre-commit run --all-files
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.0.tar.gz.
File metadata
- Download URL: empire_core-0.2.0.tar.gz
- Upload date:
- Size: 236.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0fb3701441314b92e7bd585137264fe6ace2e21ea1a10db9bc24959e441beee
|
|
| MD5 |
391d50f7973844c6ef469357217df83b
|
|
| BLAKE2b-256 |
6f4ff9235f1ff8de6e0702ad538c0786ee6cc64e942c9ace13a2a7796d076b0c
|
Provenance
The following attestation bundles were made for empire_core-0.2.0.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.0.tar.gz -
Subject digest:
f0fb3701441314b92e7bd585137264fe6ace2e21ea1a10db9bc24959e441beee - Sigstore transparency entry: 786321150
- Sigstore integration time:
-
Permalink:
eschnitzler/EmpireCore@272e3c3f38694da164af65b39d30f75a7dc582b0 -
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@272e3c3f38694da164af65b39d30f75a7dc582b0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file empire_core-0.2.0-py3-none-any.whl.
File metadata
- Download URL: empire_core-0.2.0-py3-none-any.whl
- Upload date:
- Size: 81.9 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 |
0af0d5404f3017f8c71d11095ed4a4febc2c90dde20afcc3caab895153f19ac1
|
|
| MD5 |
cc303f2686cc19813d4fb96ea2745eb4
|
|
| BLAKE2b-256 |
56eb7ea2e8e657b91585228b611d257539adf4bfe7fb9e2e8a530c4b7a67d1c6
|
Provenance
The following attestation bundles were made for empire_core-0.2.0-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.0-py3-none-any.whl -
Subject digest:
0af0d5404f3017f8c71d11095ed4a4febc2c90dde20afcc3caab895153f19ac1 - Sigstore transparency entry: 786321154
- Sigstore integration time:
-
Permalink:
eschnitzler/EmpireCore@272e3c3f38694da164af65b39d30f75a7dc582b0 -
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@272e3c3f38694da164af65b39d30f75a7dc582b0 -
Trigger Event:
workflow_dispatch
-
Statement type: