Skip to content

Latest commit

 

History

History
108 lines (80 loc) · 3.22 KB

README.md

File metadata and controls

108 lines (80 loc) · 3.22 KB

SpaceTraders Zero

License: MIT Python Code style: black Imports: isort

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.

Features

  • 🚀 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.

Prerequisites

  • 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/)

Installation

  1. Clone the repository:
git clone https://github.com/Orinks/spacetraders-zero.git
cd spacetraders-zero
  1. Install dependencies:
pip install -r requirements.txt
  1. 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

Usage

Run the client:

python src/main.py

For development and testing:

# Run tests
pytest

# Type checking
mypy .

# Format code
black .
isort .

Project Structure

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

Development

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

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • SpaceTraders API team for providing the game platform
  • All contributors who help improve this project