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
from autotraders import session
s = session.get_session("YOUR_TOKEN_HERE")
And now you're all set to use they actual API.
Ships
from autotraders.ship import Ship
from autotraders.session import get_session
# create a session here
session = get_session("YOUR TOKEN HERE")
ship = Ship("SYMBOL-Here", session) # This makes an API request
ships = Ship.all(session) # This also only makes one API request
ship.dock()
ship.refuel()
ship.orbit() # All these functions make API calls (one each), but the line below doesn't make any
print(ship.fuel.current + "/" + ship.fuel.total)
Contract
from autotraders.faction.contract import Contract
from autotraders.session import get_session
# create a session here
session = get_session("YOUR TOKEN HERE")
contract = Contract("id-here", session)
contracts = Contract.all(session)
contract.accept()
print(contract.accepted) # True
contract.deliver("SHIP_SYMBOL", "ALUMINUM_ORE", 30)
contract.fulfill()
print(contract.fulfilled) # True
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-2.2.6.tar.gz
(19.4 kB
view hashes)
Built Distribution
Close
Hashes for autotraders-2.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58966be3eb94535dd5f2a25fca835a660f2bc8e650701a34f3a43a3e9738f2d4 |
|
MD5 | 4d15e9fbc5475025061484fed25ece55 |
|
BLAKE2b-256 | a4004f38e2a7e31a32e0d53108670084479f4c74e62f009a4fb005aad4d435f6 |