Skip to main content

A python sdk for the SpaceTradersAPI game

Project description

spacetraders-sdk-v2

Total rewrite to use no generated code Currently restructuring folders to be a package-able

Installation & Usage

pip install -r requirements.txt
py api.py

TODO

  • redo all endpoints
  • logging
  • database connections
  • error handling
  • add monitoring, measure time of the requests and send them to the db aswell
  • add cooldown to database
  • add contracts to database
  • add surveys to database
  • add which ship surveyed
  • add agent to database
  • add extractions to database
  • add transactions to database
  • add new endpoints
  • shipyards: transactions
  • shipyardsships: requirements
  • shipyards, shipyardsships with mounts etc

Generator

  • implement enums
  • implement jsons like ShipCondition

Documentation for API Endpoints

Class HTTP request Description Implemented
get / Status leaderboard db
post /register Register New Agent statekeeping
Agents get /my/agent Fetch your agent's details. statekeeping
Agents get /my/agent/events last 60 seconds of events
Contracts get /my/contracts List all of your contracts. statekeeping
Contracts get /my/contracts/{contractId} Get the details of a contract by ID. statekeeping
Contracts post /my/contracts/{contractId}/accept Accept a contract. statekeeping
Contracts post /my/contracts/{contractId}/deliver Deliver cargo on a given contract. statekeeping & db/2
Contracts post /my/contracts/{contractId}/fulfill Fulfill a contract statekeeping
Factions get /factions List all discovered factions in the game. statekeeping & db
Factions get /factions/{factionSymbol} View the details of a faction. statekeeping & db
Factions get /my/factions Get your faction reputation
Fleet get /my/ships Retrieve all of your ships. statekeeping & db
Fleet post /my/ships Purchase a ship statekeeping & db/2
Fleet get /my/ships/{shipSymbol} Retrieve the details of your ship. statekeeping & db
Fleet get /my/ships/{shipSymbol}/cargo Retrieve the cargo of your ship. statekeeping & db
Fleet post /my/ships/{shipSymbol}/orbit Orbit Ship statekeeping & db
Fleet post /my/ships/{shipSymbol}/refine Ship Refine
Fleet post /my/ships/{shipSymbol}/chart Create Chart statekeeping & db
Fleet get /my/ships/{shipSymbol}/cooldown Get Ship Cooldown statekeeping
Fleet post /my/ships/{shipSymbol}/dock Dock Ship statekeeping & db
Fleet post /my/ships/{shipSymbol}/survey Create Survey statekeeping
Fleet post /my/ships/{shipSymbol}/extract Extract Resources statekeeping & db/2
Fleet post /my/ships/{shipSymbol}/jettison Jettison Cargo
Fleet post /my/ships/{shipSymbol}/jump Jump Ship statekeeping & db/2
Fleet post /my/ships/{shipSymbol}/navigate Navigate Ship statekeeping & db
Fleet post /my/ships/{shipSymbol}/negotiate/contract Negotiate Contract
Fleet patch /my/ships/{shipSymbol}/nav Patch Ship Nav
Fleet get /my/ships/{shipSymbol}/nav Get Ship Nav
Fleet post /my/ships/{shipSymbol}/warp Warp Ship statekeeping & db
Fleet post /my/ships/{shipSymbol}/sell Sell Cargo statekeeping & db
Fleet post /my/ships/{shipSymbol}/scan/systems Scan Systems
Fleet post /my/ships/{shipSymbol}/scan/waypoints Scan Waypoints
Fleet post /my/ships/{shipSymbol}/scan/ships Scan Ships
Fleet post /my/ships/{shipSymbol}/refuel Refuel Ship statekeeping & db
Fleet post /my/ships/{shipSymbol}/purchase Purchase Cargo statekeeping & db
Fleet post /my/ships/{shipSymbol}/transfer Transfer Cargo statekeeping & db
Fleet get /my/ships/{shipSymbol}/mounts Get the mounts on a ship.
Fleet post /my/ships/{shipSymbol}/mounts Install a mount on a ship.
Fleet post /my/ships/{shipSymbol}/mounts/remove Remove a mount from a ship.
Systems get /systems List Systems statekeeping & db
Systems get /systems.json Get all systems. statekeeping & db
Systems get /systems/{systemSymbol} Get System statekeeping & db
Systems get /systems/{systemSymbol}/waypoints List Waypoints statekeeping & db
Systems get /systems/{systemSymbol}/waypoints/{waypointSymbol} Get Waypoint statekeeping & db
Systems get /systems/{systemSymbol}/waypoints/{waypointSymbol}/market Get Market statekeeping & db
Systems get /systems/{systemSymbol}/waypoints/{waypointSymbol}/shipyard Get Shipyard statekeeping & db
Systems get /systems/{systemSymbol}/waypoints/{waypointSymbol}/jump-gate Get Jump Gate statekeeping

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacetraders_sdk-2.0.3.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spacetraders_sdk-2.0.3-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file spacetraders_sdk-2.0.3.tar.gz.

File metadata

  • Download URL: spacetraders_sdk-2.0.3.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for spacetraders_sdk-2.0.3.tar.gz
Algorithm Hash digest
SHA256 d7a1b44ccdd229f48942ef7dc5db49a8998e19f3801b2e2ea9474f05dc0740f0
MD5 e476a13b1ee6451adffa2a09c3675fde
BLAKE2b-256 1352515498a9e5364c08cf2d64e7832ac420fa31e815c1bfd674c5886ce4dfe3

See more details on using hashes here.

File details

Details for the file spacetraders_sdk-2.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for spacetraders_sdk-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4864821c2bef036cc0db9181cf581bf64fc2489b28c4be9e5418ba72663206d3
MD5 5127424530a5d98d5d4c3ac6cf376bd3
BLAKE2b-256 56185ef52083f62f09b68f7f9ac644a8e174eef98a5d825343af5a49e0c8d893

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page