Skip to content

Progress quest...in spaaaaace! Or at least that's the idea.

License

Notifications You must be signed in to change notification settings

Orinks/Spacetraders-Zero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpaceTraders Zero

An accessible zero-player game powered by SpaceTraders.io API with an accessible wxPython graphical interface.

Features

  • 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

Installation

  1. Create a virtual environment:
python -m venv venv
  1. Activate the virtual environment:
  • Windows: venv\Scripts\activate
  • Unix/MacOS: source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. (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.

  1. Run the game:
python -m src.main

Project Structure

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

Development

The project uses Python 3.12+ and follows strict type checking with mypy. Key development tools:

  • mypy for static type checking
  • pytest for testing
  • wxPython for GUI
  • pydantic for configuration and data validation

State Management

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

API Integration

The SpaceTraders API integration includes:

  • Rate limiting protection
  • Circuit breaker pattern
  • Request caching
  • Error handling and retries

About

Progress quest...in spaaaaace! Or at least that's the idea.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages