Skip to main content

Access the Space Traders API with Python

Project description

SpacePyTraders

The Python SDK to interact with the Space Traders API.

Read the documentation here: https://spacetraders.readthedocs.io/en/latest/

Space Traders is a great way to learn a practice coding. I highly recommend having a go at using the Requests library and interacting with the API yourself as practice but you can install this library to skip the boring work of coding for each API endpoint.

Install

pip install SpacePyTraders

Getting Started

The first installment of this library provides a nice way to use Python and interact with the API without needed to code all the request calls.

Using the Api class provided you can access all the currently possible endpoints of the API. The structure of the classes are organised the same as the Space Traders API. So if you're not sure what class to look under check the docs here or the Space Trader's API here.

from SpacePyTraders import client

USERNAME = "YOUR USERNAME"
TOKEN = "YOUR TOKEN"

api = client.Api(USERNAME,TOKEN)

print(api.account.info())

>>> 
{
    "user": {
        "username": "JimHawkins",
        "credits": 0,
        "ships": [],
        "loans": []
    }
}

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

SpacePyTraders-0.0.6.tar.gz (31.6 kB view details)

Uploaded Source

File details

Details for the file SpacePyTraders-0.0.6.tar.gz.

File metadata

  • Download URL: SpacePyTraders-0.0.6.tar.gz
  • Upload date:
  • Size: 31.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for SpacePyTraders-0.0.6.tar.gz
Algorithm Hash digest
SHA256 27ebb986b1065912b259353b3a595504c7b9491c26f01b384365eec82ddb43fc
MD5 c5e2d934244b757b92292862d3ac47b7
BLAKE2b-256 76b0c3f4e67e0b6addda499c6f9fb423a1569dc7fb6e58ab569313377167dc43

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