autotraders.ship package#

Submodules#

autotraders.ship.cargo module#

class autotraders.ship.cargo.Cargo(symbol, session: AutoTradersSession, data: dict | None = None)#

Bases: SpaceTradersEntity

capacity: int#
current: int#
inventory: list[Item]#
update(data: dict | None = None) None#

autotraders.ship.nav module#

class autotraders.ship.nav.Nav(symbol, session: AutoTradersSession, data: dict | None = None)#

Bases: SpaceTradersEntity

dock()#
flight_mode: str#
jump(destination: str | MapSymbol)#
location: WaypointSymbol#
moving: bool#
navigate(destination: str | MapSymbol)#
orbit()#
patch_flight_mode(new_flight_mode: str | FlightMode)#
route: Route#
status: str#
symbol: str#
update(data: dict | None = None) None#
warp(destination: str | MapSymbol)#
class autotraders.ship.nav.Route(data, session)#

Bases: object

autotraders.ship.ship_components module#

class autotraders.ship.ship_components.Engine(*, symbol: str, name: str, description: str | None = None, condition: int | None = None, requirements: Requirements, speed: int)#

Bases: ShipComponent

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'condition': FieldInfo(annotation=Union[int, NoneType], required=False), 'description': FieldInfo(annotation=Union[str, NoneType], required=False), 'name': FieldInfo(annotation=str, required=True), 'requirements': FieldInfo(annotation=Requirements, required=True), 'speed': FieldInfo(annotation=int, required=True), 'symbol': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

speed: int#
class autotraders.ship.ship_components.Frame(*, symbol: str, name: str, description: str | None = None, condition: int | None = None, requirements: Requirements, moduleSlots: int, mountingPoints: int, fuelCapacity: int)#

Bases: ShipComponent

fuel_capacity: int#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'condition': FieldInfo(annotation=Union[int, NoneType], required=False), 'description': FieldInfo(annotation=Union[str, NoneType], required=False), 'fuel_capacity': FieldInfo(annotation=int, required=True, alias='fuelCapacity', alias_priority=2), 'module_slots': FieldInfo(annotation=int, required=True, alias='moduleSlots', alias_priority=2), 'mounting_points': FieldInfo(annotation=int, required=True, alias='mountingPoints', alias_priority=2), 'name': FieldInfo(annotation=str, required=True), 'requirements': FieldInfo(annotation=Requirements, required=True), 'symbol': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

module_slots: int#
mounting_points: int#
class autotraders.ship.ship_components.Module(*, symbol: str, name: str, description: str | None = None, condition: int | None = None, requirements: Requirements, capacity: int | None = None, range: int | None = None)#

Bases: ShipComponent

capacity: int | None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'capacity': FieldInfo(annotation=Union[int, NoneType], required=False), 'condition': FieldInfo(annotation=Union[int, NoneType], required=False), 'description': FieldInfo(annotation=Union[str, NoneType], required=False), 'name': FieldInfo(annotation=str, required=True), 'range': FieldInfo(annotation=Union[int, NoneType], required=False), 'requirements': FieldInfo(annotation=Requirements, required=True), 'symbol': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

range: int | None#
class autotraders.ship.ship_components.Mount(*, symbol: str, name: str, description: str | None = None, condition: int | None = None, requirements: Requirements, strength: int | None = None, deposits: list[str] | None = None)#

Bases: ShipComponent

deposits: list[str] | None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'condition': FieldInfo(annotation=Union[int, NoneType], required=False), 'deposits': FieldInfo(annotation=Union[list[str], NoneType], required=False), 'description': FieldInfo(annotation=Union[str, NoneType], required=False), 'name': FieldInfo(annotation=str, required=True), 'requirements': FieldInfo(annotation=Requirements, required=True), 'strength': FieldInfo(annotation=Union[int, NoneType], required=False), 'symbol': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

strength: int | None#
class autotraders.ship.ship_components.Reactor(*, symbol: str, name: str, description: str | None = None, condition: int | None = None, requirements: Requirements, powerOutput: int)#

Bases: ShipComponent

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'condition': FieldInfo(annotation=Union[int, NoneType], required=False), 'description': FieldInfo(annotation=Union[str, NoneType], required=False), 'name': FieldInfo(annotation=str, required=True), 'power_output': FieldInfo(annotation=int, required=True, alias='powerOutput', alias_priority=2), 'requirements': FieldInfo(annotation=Requirements, required=True), 'symbol': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

power_output: int#
class autotraders.ship.ship_components.Requirements(*, power: int | None = None, crew: int | None = None, slots: int | None = None)#

Bases: BaseModel

crew: int | None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'crew': FieldInfo(annotation=Union[int, NoneType], required=False), 'power': FieldInfo(annotation=Union[int, NoneType], required=False), 'slots': FieldInfo(annotation=Union[int, NoneType], required=False)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

power: int | None#
slots: int | None#
class autotraders.ship.ship_components.ShipComponent(*, symbol: str, name: str, description: str | None = None, condition: int | None = None, requirements: Requirements)#

Bases: BaseModel

condition: int | None#
description: str | None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'condition': FieldInfo(annotation=Union[int, NoneType], required=False), 'description': FieldInfo(annotation=Union[str, NoneType], required=False), 'name': FieldInfo(annotation=str, required=True), 'requirements': FieldInfo(annotation=Requirements, required=True), 'symbol': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str#
requirements: Requirements#
symbol: str#

autotraders.ship.states module#

class autotraders.ship.states.FlightMode(value)#

Bases: str, Enum

An enumeration.

BURN = 'BURN'#
CRUISE = 'CRUISE'#
DRIFT = 'DRIFT'#
STEALTH = 'STEALTH'#
class autotraders.ship.states.NavState(value)#

Bases: str, Enum

An enumeration.

DOCKED = 'DOCKED'#
IN_ORBIT = 'IN_ORBIT'#
IN_TRANSIT = 'IN_TRANSIT'#

autotraders.ship.survey module#

class autotraders.ship.survey.SizeEnum(value)#

Bases: str, Enum

An enumeration.

LARGE = 'LARGE'#
MODERATE = 'MODERATE'#
SMALL = 'SMALL'#
class autotraders.ship.survey.Survey(*, signature: str, symbol: str, deposits: list[dict[str, str]], expiration: datetime, size: SizeEnum)#

Bases: BaseModel

deposits: list[dict[str, str]]#
expiration: datetime#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'deposits': FieldInfo(annotation=list[dict[str, str]], required=True), 'expiration': FieldInfo(annotation=datetime, required=True), 'signature': FieldInfo(annotation=str, required=True), 'size': FieldInfo(annotation=SizeEnum, required=True), 'symbol': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

signature: str#
size: SizeEnum#
symbol: str#

Module contents#

class autotraders.ship.Capabilities(modules, mounts)#

Bases: object

Variables:
  • warp – can the ship warp

  • jump – can the ship jump without a jump gate

  • mine – can the ship mine (experimental)

class autotraders.ship.Crew(*, current: int, required: int, capacity: int, morale: int, wages: int, rotation: RotationEnum)#

Bases: BaseModel

capacity: int#
current: int#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'capacity': FieldInfo(annotation=int, required=True), 'current': FieldInfo(annotation=int, required=True), 'morale': FieldInfo(annotation=int, required=True), 'required': FieldInfo(annotation=int, required=True), 'rotation': FieldInfo(annotation=RotationEnum, required=True), 'wages': FieldInfo(annotation=int, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

morale: int#
required: int#
rotation: RotationEnum#
wages: int#
class autotraders.ship.Registration(*, name: str, factionSymbol: str, role: str)#

Bases: BaseModel

faction_symbol: str#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'faction_symbol': FieldInfo(annotation=str, required=True, alias='factionSymbol', alias_priority=2), 'name': FieldInfo(annotation=str, required=True), 'role': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str#
role: str#
class autotraders.ship.RotationEnum(value)#

Bases: str, Enum

An enumeration.

RELAXED = 'RELAXED'#
STRICT = 'STRICT'#
class autotraders.ship.Ship(symbol, session: AutoTradersSession, data: dict | None = None)#

Bases: SpaceTradersEntity

static all(session, page: int = 1) PaginatedList#
async await_cooldown()#
async await_transit()#
buy(cargo_symbol: str, quantity: int)#
capabilities: Capabilities | None#
cargo: Cargo#
chart() Waypoint#

Charts the current waypoint

Returns:

The info about the waypoint that has been charted

cooldown: Cooldown | None#
crew: Crew#
dock()#
engine: Engine#
extract(extraction_survey: Survey | None = None)#
frame: Frame#
fuel: Fuel#
install_mount(mount_symbol: str)#
jettison(cargo_symbol: str, quantity: int)#
jump(destination: str | MapSymbol)#
modules: list[Module]#
mounts: list[Mount]#
nav: Nav#
navigate(waypoint: str | MapSymbol)#

Attempts to move ship to the provided waypoint. If the request succeeds, this function exits immediately, and does not wait the ship to arrive.

orbit()#
patch_navigation(new_flight_mode: str | FlightMode)#
reactor: Reactor#
refine(output_symbol: str)#
refuel(from_cargo=False, units=None)#
registration: Registration#
remove_mount(mount_symbol: str)#
scan_ships() list#
scan_systems() list[System]#
scan_waypoints() list[Waypoint]#
sell(cargo_symbol: str, quantity: int)#
siphon()#
survey() list[Survey]#
symbol: str#
transfer(destination: str, cargo_symbol: str, quantity: int)#
update(data: dict | None = None) None#
wait_cooldown()#
wait_transit()#
warp(destination: str | MapSymbol)#