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
Built Distribution
Hashes for SpacePyTraders-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfba16a9f288e480234704663a8185f2df01368a681f1a76f459650f49d00fb3 |
|
MD5 | 0d9d9b22723b57da5bba0539bff251bb |
|
BLAKE2b-256 | c740bcceebf78c196727670c8eed3d076f6248b11c99a622e1aab001e938de0c |