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.faction.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.6.2.tar.gz
(15.3 kB
view hashes)
Built Distribution
Close
Hashes for autotraders-1.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7f71185c968676c89baf30693f02a6a7e813e0b1b3bb4a7ba55a1bcbe142006 |
|
MD5 | df559f001fb7cb661a322146f34b6ec5 |
|
BLAKE2b-256 | d2cb87a8d2c2ef2745938906e8ae02a0782c0a1a650b6f35c5bd68daad677f37 |