A powerful spacetraders API
Project description
Autotraders
A spacetraders API focused on automation and ease of use
Usage
First you need a client, which can be generated
import requests
class BearerAuth(requests.auth.AuthBase):
def __init__(self, token):
self.token = token
def __call__(self, r):
r.headers["authorization"] = "Bearer " + self.token
return r
token = TOKEN_HERE
s = requests.Session()
s.auth = BearerAuth(token)
And now you're all set to use they actual API.
Ships
from autotraders.ships import Ship
# create a session here
ship = Ship("SYMBOL-Here", session) # This makes an API request
ship.dock()
ship.refuel()
ship.orbit()
print(ship.fuel.current + "/" + ship.fuel.total)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
autotraders-0.1.0.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for autotraders-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31b3a96d3c8105a2bf11603e649078a1ae258500c292844cdbd51dded1837f9e |
|
MD5 | 931a414adc65fcb91c230124d92f98ca |
|
BLAKE2b-256 | 92374124d0247f602e812778e4e91a2d838da15991c3541bcb0f52a423c8df35 |