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, get_all_ships
# create a session here
ship = Ship("SYMBOL-Here", session) # This makes an API request
ships = get_all_ships(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
print(ship.fuel.current + "/" + ship.fuel.total)
Contract
from autotraders.contract import Contract, get_all_contracts
# create a session here
contract = Contract("id-here", session)
contracts = get_all_contracts(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-1.0.4.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for autotraders-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c730a6e3b044e9b9b2cdbcd7c0d02425d58e7cbfe5cb3a6d5f3dbfd4f325819d |
|
MD5 | 9558f169d0118cbb15be642edaedac25 |
|
BLAKE2b-256 | a88f1ebb58d8017cd7e0489a72b23204ca51856dd8e47a4b5b6dc38eb978c66a |