An accessible zero-player game powered by SpaceTraders.io API with an accessible wxPython graphical interface.
- Automated agent activities in SpaceTraders universe
- Accessible UI with screen reader support
- Real-time monitoring of agent actions
- Automated trading and navigation
- State persistence and management
- Rate limiting and circuit breaker protection
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- Windows:
venv\Scripts\activate
- Unix/MacOS:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- (Optional) Create a
.env
file with your SpaceTraders API key:
SPACETRADERS_TOKEN=your_token_here
Note: If you don't have a token yet, you can register a new agent through the UI which will automatically save your token.
- Run the game:
python -m src.main
spacetraders-zero/
├── src/
│ ├── main.py # Entry point
│ ├── api/ # SpaceTraders API integration
│ │ ├── client.py # API client
│ │ ├── rate_limiter.py # Rate limiting
│ │ └── circuit_breaker.py # Circuit breaker pattern
│ ├── agents/ # Agent logic
│ │ ├── trader.py # Trading agent
│ │ └── trading/ # Trading strategies
│ ├── ui/ # User interface
│ │ └── main_window.py # Main UI window
│ └── persistence.py # State management
├── tests/ # Unit tests
├── requirements.txt # Dependencies
└── README.md # Documentation
The project uses Python 3.12+ and follows strict type checking with mypy. Key development tools:
mypy
for static type checkingpytest
for testingwxPython
for GUIpydantic
for configuration and data validation
The application includes persistent state management that:
- Automatically saves agent state periodically
- Maintains state history
- Uses SQLite for storage
- Implements state hashing for change detection
The SpaceTraders API integration includes:
- Rate limiting protection
- Circuit breaker pattern
- Request caching
- Error handling and retries