An automated client for the SpaceTraders API game (https://spacetraders.io/). This client provides a robust interface for interacting with the SpaceTraders API, featuring automated trading, resource management, and strategic decision-making capabilities.
- 🚀 Automated trading and resource management
- 🛸 Ship navigation and fleet management
- 📊 Market analysis and optimal route planning
- 📝 Automated contract handling
- ⚡ High-performance async operations
- 🔒 Secure API token handling
- 🧪 Comprehensive test coverage
Note: there are two mining modes for debugging purposes for now; Coordinated mining I aim to be the default as soon as everything works great. Todo: everything except mining.
- Python 3.8 or higher
- pip (Python package installer)
- A SpaceTraders API token (The script should handle this for you, but check out the website anyhow) https://spacetraders.io/)
- Clone the repository:
git clone https://github.com/Orinks/spacetraders-zero.git
cd spacetraders-zero
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file in the root directory with your SpaceTraders API token:
Note: if running for the first time, the .env file will be created for you. Feel free to manually add API tokens if you started a run before the next reset happens.
SPACETRADERS_TOKEN=your_token_here
Run the client:
python src/main.py
For development and testing:
# Run tests
pytest
# Type checking
mypy .
# Format code
black .
isort .
spacetraders-zero/
├── src/
│ ├── main.py # Main entry point
│ ├── client.py # SpaceTraders API client
│ ├── models.py # Pydantic models
│ ├── automation/ # Automation strategies
│ └── utils/ # Utility functions
├── tests/ # Test suite
├── requirements.txt # Project dependencies
└── README.md # This file
This project follows these best practices:
- Type hints for all function signatures
- Comprehensive test coverage
- Clean code principles
- Modern Python async/await patterns
- Proper error handling and logging
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- SpaceTraders API team for providing the game platform
- All contributors who help improve this project