Skip to main content

A powerful spacetraders API

Project description

Autotraders

Downloads Python package

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


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.3.5.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autotraders-2.3.5-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file autotraders-2.3.5.tar.gz.

File metadata

  • Download URL: autotraders-2.3.5.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for autotraders-2.3.5.tar.gz
Algorithm Hash digest
SHA256 18230d1a2128a711010dd13ea064d690883f3f5fea738f8ccb46fe38370b80f3
MD5 4b19cb4a71711bdff2cac4ea94b976bc
BLAKE2b-256 9c7419a8d1f985dae79808077fee23206f0d7634857223fa4f464ae9bc802663

See more details on using hashes here.

File details

Details for the file autotraders-2.3.5-py3-none-any.whl.

File metadata

  • Download URL: autotraders-2.3.5-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for autotraders-2.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 388ea6a2f503264e2b6126e9200b6dfb88477454a5e9526f2801b7f5d72c033e
MD5 a6a22ba13471bf6bfefc7b829447175c
BLAKE2b-256 40066ff7da5e51d8ff2ca0c49f7bb30eaa4e9f4d3d0721e2e417e0efdcf5c097

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page