Skip to content

Instantly share code, notes, and snippets.

@agrif
Last active June 19, 2025 18:07
Show Gist options
  • Save agrif/986b7e9f57472843d51ed37087f65a09 to your computer and use it in GitHub Desktop.
Save agrif/986b7e9f57472843d51ed37087f65a09 to your computer and use it in GitHub Desktop.
from __future__ import annotations
import dataclasses
import datetime as dt
import enum
import typing
__all__ = [
'Faction', 'FactionSymbol', 'FactionTrait', 'FactionTraitSymbol',
'Meta', 'PublicAgent', 'System', 'SystemType', 'SystemWaypoint',
'str', 'WaypointType', 'WaypointOrbital', 'SystemFaction', 'Waypoint',
'str', 'WaypointFaction', 'WaypointTrait', 'WaypointTraitSymbol',
'WaypointModifier', 'WaypointModifierSymbol', 'Chart', 'Construction',
'ConstructionMaterial', 'TradeSymbol', 'ShipCargo', 'ShipCargoItem',
'Market', 'TradeGood', 'MarketTransaction', 'MarketTradeGood',
'SupplyLevel', 'ActivityLevel', 'JumpGate', 'Shipyard', 'ShipType',
'ShipyardTransaction', 'ShipyardShip', 'ShipFrame', 'float', 'float',
'ShipRequirements', 'float', 'ShipReactor', 'ShipEngine',
'ShipModule', 'ShipMount', 'Contract', 'ContractTerms',
'ContractPayment', 'ContractDeliverGood', 'Agent', 'AgentEvent',
'Ship', 'ShipRegistration', 'ShipRole', 'ShipNav', 'ShipNavRoute',
'ShipNavRouteWaypoint', 'ShipNavStatus', 'ShipNavFlightMode',
'ShipCrew', 'ShipFuel', 'Cooldown', 'ChartTransaction', 'Extraction',
'ExtractionYield', 'ShipConditionEvent', 'Survey', 'SurveyDeposit',
'SurveySize', 'ScannedSystem', 'ScannedWaypoint', 'ScannedShip',
'ScrapTransaction', 'RepairTransaction', 'Siphon', 'SiphonYield',
'ShipModificationTransaction',
]
@dataclasses.dataclass
class Faction:
"""Faction details."""
# The symbol of the faction.
symbol: FactionSymbol
# Name of the faction.
name: str
# Description of the faction.
description: str
# List of traits that define this faction.
traits: list[FactionTrait]
# Whether or not the faction is currently recruiting new agents.
is_recruiting: bool
# The waypoint in which the faction's HQ is located in.
headquarters: str | None = None
class FactionSymbol(enum.Enum):
"""The symbol of the faction."""
COSMIC = 'COSMIC'
VOID = 'VOID'
GALACTIC = 'GALACTIC'
QUANTUM = 'QUANTUM'
DOMINION = 'DOMINION'
ASTRO = 'ASTRO'
CORSAIRS = 'CORSAIRS'
OBSIDIAN = 'OBSIDIAN'
AEGIS = 'AEGIS'
UNITED = 'UNITED'
SOLITARY = 'SOLITARY'
COBALT = 'COBALT'
OMEGA = 'OMEGA'
ECHO = 'ECHO'
LORDS = 'LORDS'
CULT = 'CULT'
ANCIENTS = 'ANCIENTS'
SHADOW = 'SHADOW'
ETHEREAL = 'ETHEREAL'
@dataclasses.dataclass
class FactionTrait:
# The unique identifier of the trait.
symbol: FactionTraitSymbol
# The name of the trait.
name: str
# A description of the trait.
description: str
class FactionTraitSymbol(enum.Enum):
"""The unique identifier of the trait."""
BUREAUCRATIC = 'BUREAUCRATIC'
SECRETIVE = 'SECRETIVE'
CAPITALISTIC = 'CAPITALISTIC'
INDUSTRIOUS = 'INDUSTRIOUS'
PEACEFUL = 'PEACEFUL'
DISTRUSTFUL = 'DISTRUSTFUL'
WELCOMING = 'WELCOMING'
SMUGGLERS = 'SMUGGLERS'
SCAVENGERS = 'SCAVENGERS'
REBELLIOUS = 'REBELLIOUS'
EXILES = 'EXILES'
PIRATES = 'PIRATES'
RAIDERS = 'RAIDERS'
CLAN = 'CLAN'
GUILD = 'GUILD'
DOMINION = 'DOMINION'
FRINGE = 'FRINGE'
FORSAKEN = 'FORSAKEN'
ISOLATED = 'ISOLATED'
LOCALIZED = 'LOCALIZED'
ESTABLISHED = 'ESTABLISHED'
NOTABLE = 'NOTABLE'
DOMINANT = 'DOMINANT'
INESCAPABLE = 'INESCAPABLE'
INNOVATIVE = 'INNOVATIVE'
BOLD = 'BOLD'
VISIONARY = 'VISIONARY'
CURIOUS = 'CURIOUS'
DARING = 'DARING'
EXPLORATORY = 'EXPLORATORY'
RESOURCEFUL = 'RESOURCEFUL'
FLEXIBLE = 'FLEXIBLE'
COOPERATIVE = 'COOPERATIVE'
UNITED = 'UNITED'
STRATEGIC = 'STRATEGIC'
INTELLIGENT = 'INTELLIGENT'
RESEARCH_FOCUSED = 'RESEARCH_FOCUSED'
COLLABORATIVE = 'COLLABORATIVE'
PROGRESSIVE = 'PROGRESSIVE'
MILITARISTIC = 'MILITARISTIC'
TECHNOLOGICALLY_ADVANCED = 'TECHNOLOGICALLY_ADVANCED'
AGGRESSIVE = 'AGGRESSIVE'
IMPERIALISTIC = 'IMPERIALISTIC'
TREASURE_HUNTERS = 'TREASURE_HUNTERS'
DEXTEROUS = 'DEXTEROUS'
UNPREDICTABLE = 'UNPREDICTABLE'
BRUTAL = 'BRUTAL'
FLEETING = 'FLEETING'
ADAPTABLE = 'ADAPTABLE'
SELF_SUFFICIENT = 'SELF_SUFFICIENT'
DEFENSIVE = 'DEFENSIVE'
PROUD = 'PROUD'
DIVERSE = 'DIVERSE'
INDEPENDENT = 'INDEPENDENT'
SELF_INTERESTED = 'SELF_INTERESTED'
FRAGMENTED = 'FRAGMENTED'
COMMERCIAL = 'COMMERCIAL'
FREE_MARKETS = 'FREE_MARKETS'
ENTREPRENEURIAL = 'ENTREPRENEURIAL'
@dataclasses.dataclass
class Meta:
"""Meta details for pagination."""
# Shows the total amount of items of this kind that exist.
total: int
# A page denotes an amount of items, offset from the first item.
# Each page holds an amount of items equal to the `limit`.
page: int
# The amount of items in each page. Limits how many items can be
# fetched at once.
limit: int
@dataclasses.dataclass
class PublicAgent:
"""Public agent details."""
# Symbol of the agent.
symbol: str
# The headquarters of the agent.
headquarters: str
# The number of credits the agent has available. Credits can be
# negative if funds have been overdrawn.
credits: int
# The faction the agent started with.
starting_faction: str
# How many ships are owned by the agent.
ship_count: int
@dataclasses.dataclass
class System:
"""System details."""
# The symbol of the system.
symbol: str
# The symbol of the sector.
sector_symbol: str
# The type of system.
type: SystemType
# Relative position of the system in the sector in the x axis.
x: int
# Relative position of the system in the sector in the y axis.
y: int
# Waypoints in this system.
waypoints: list[SystemWaypoint]
# Factions that control this system.
factions: list[SystemFaction]
# The constellation that the system is part of.
constellation: str | None = None
# The name of the system.
name: str | None = None
class SystemType(enum.Enum):
"""The type of system."""
NEUTRON_STAR = 'NEUTRON_STAR'
RED_STAR = 'RED_STAR'
ORANGE_STAR = 'ORANGE_STAR'
BLUE_STAR = 'BLUE_STAR'
YOUNG_STAR = 'YOUNG_STAR'
WHITE_DWARF = 'WHITE_DWARF'
BLACK_HOLE = 'BLACK_HOLE'
HYPERGIANT = 'HYPERGIANT'
NEBULA = 'NEBULA'
UNSTABLE = 'UNSTABLE'
@dataclasses.dataclass
class SystemWaypoint:
"""Waypoint details."""
# The symbol of the waypoint.
symbol: str
# The type of waypoint.
type: WaypointType
# Relative position of the waypoint on the system's x axis. This
# is not an absolute position in the universe.
x: int
# Relative position of the waypoint on the system's y axis. This
# is not an absolute position in the universe.
y: int
# Waypoints that orbit this waypoint.
orbitals: list[WaypointOrbital]
# The symbol of the parent waypoint, if this waypoint is in orbit
# around another waypoint. Otherwise this value is undefined.
orbits: str | None = None
class WaypointType(enum.Enum):
"""The type of waypoint."""
PLANET = 'PLANET'
GAS_GIANT = 'GAS_GIANT'
MOON = 'MOON'
ORBITAL_STATION = 'ORBITAL_STATION'
JUMP_GATE = 'JUMP_GATE'
ASTEROID_FIELD = 'ASTEROID_FIELD'
ASTEROID = 'ASTEROID'
ENGINEERED_ASTEROID = 'ENGINEERED_ASTEROID'
ASTEROID_BASE = 'ASTEROID_BASE'
NEBULA = 'NEBULA'
DEBRIS_FIELD = 'DEBRIS_FIELD'
GRAVITY_WELL = 'GRAVITY_WELL'
ARTIFICIAL_GRAVITY_WELL = 'ARTIFICIAL_GRAVITY_WELL'
FUEL_STATION = 'FUEL_STATION'
@dataclasses.dataclass
class WaypointOrbital:
"""An orbital is another waypoint that orbits a parent waypoint."""
# The symbol of the orbiting waypoint.
symbol: str
@dataclasses.dataclass
class SystemFaction:
# The symbol of the faction.
symbol: FactionSymbol
@dataclasses.dataclass
class Waypoint:
"""A waypoint is a location that ships can travel to such as a
Planet, Moon or Space Station.
"""
# The symbol of the waypoint.
symbol: str
# The type of waypoint.
type: WaypointType
# The symbol of the system.
system_symbol: str
# Relative position of the waypoint on the system's x axis. This
# is not an absolute position in the universe.
x: int
# Relative position of the waypoint on the system's y axis. This
# is not an absolute position in the universe.
y: int
# Waypoints that orbit this waypoint.
orbitals: list[WaypointOrbital]
# The traits of the waypoint.
traits: list[WaypointTrait]
# True if the waypoint is under construction.
is_under_construction: bool
# The symbol of the parent waypoint, if this waypoint is in orbit
# around another waypoint. Otherwise this value is undefined.
orbits: str | None = None
# The faction that controls the waypoint.
faction: WaypointFaction | None = None
# The modifiers of the waypoint.
modifiers: list[WaypointModifier] | None = None
# The chart of a system or waypoint, which makes the location
# visible to other agents.
chart: Chart | None = None
@dataclasses.dataclass
class WaypointFaction:
"""The faction that controls the waypoint."""
# The symbol of the faction.
symbol: FactionSymbol
@dataclasses.dataclass
class WaypointTrait:
# The unique identifier of the trait.
symbol: WaypointTraitSymbol
# The name of the trait.
name: str
# A description of the trait.
description: str
class WaypointTraitSymbol(enum.Enum):
"""The unique identifier of the trait."""
UNCHARTED = 'UNCHARTED'
UNDER_CONSTRUCTION = 'UNDER_CONSTRUCTION'
MARKETPLACE = 'MARKETPLACE'
SHIPYARD = 'SHIPYARD'
OUTPOST = 'OUTPOST'
SCATTERED_SETTLEMENTS = 'SCATTERED_SETTLEMENTS'
SPRAWLING_CITIES = 'SPRAWLING_CITIES'
MEGA_STRUCTURES = 'MEGA_STRUCTURES'
PIRATE_BASE = 'PIRATE_BASE'
OVERCROWDED = 'OVERCROWDED'
HIGH_TECH = 'HIGH_TECH'
CORRUPT = 'CORRUPT'
BUREAUCRATIC = 'BUREAUCRATIC'
TRADING_HUB = 'TRADING_HUB'
INDUSTRIAL = 'INDUSTRIAL'
BLACK_MARKET = 'BLACK_MARKET'
RESEARCH_FACILITY = 'RESEARCH_FACILITY'
MILITARY_BASE = 'MILITARY_BASE'
SURVEILLANCE_OUTPOST = 'SURVEILLANCE_OUTPOST'
EXPLORATION_OUTPOST = 'EXPLORATION_OUTPOST'
MINERAL_DEPOSITS = 'MINERAL_DEPOSITS'
COMMON_METAL_DEPOSITS = 'COMMON_METAL_DEPOSITS'
PRECIOUS_METAL_DEPOSITS = 'PRECIOUS_METAL_DEPOSITS'
RARE_METAL_DEPOSITS = 'RARE_METAL_DEPOSITS'
METHANE_POOLS = 'METHANE_POOLS'
ICE_CRYSTALS = 'ICE_CRYSTALS'
EXPLOSIVE_GASES = 'EXPLOSIVE_GASES'
STRONG_MAGNETOSPHERE = 'STRONG_MAGNETOSPHERE'
VIBRANT_AURORAS = 'VIBRANT_AURORAS'
SALT_FLATS = 'SALT_FLATS'
CANYONS = 'CANYONS'
PERPETUAL_DAYLIGHT = 'PERPETUAL_DAYLIGHT'
PERPETUAL_OVERCAST = 'PERPETUAL_OVERCAST'
DRY_SEABEDS = 'DRY_SEABEDS'
MAGMA_SEAS = 'MAGMA_SEAS'
SUPERVOLCANOES = 'SUPERVOLCANOES'
ASH_CLOUDS = 'ASH_CLOUDS'
VAST_RUINS = 'VAST_RUINS'
MUTATED_FLORA = 'MUTATED_FLORA'
TERRAFORMED = 'TERRAFORMED'
EXTREME_TEMPERATURES = 'EXTREME_TEMPERATURES'
EXTREME_PRESSURE = 'EXTREME_PRESSURE'
DIVERSE_LIFE = 'DIVERSE_LIFE'
SCARCE_LIFE = 'SCARCE_LIFE'
FOSSILS = 'FOSSILS'
WEAK_GRAVITY = 'WEAK_GRAVITY'
STRONG_GRAVITY = 'STRONG_GRAVITY'
CRUSHING_GRAVITY = 'CRUSHING_GRAVITY'
TOXIC_ATMOSPHERE = 'TOXIC_ATMOSPHERE'
CORROSIVE_ATMOSPHERE = 'CORROSIVE_ATMOSPHERE'
BREATHABLE_ATMOSPHERE = 'BREATHABLE_ATMOSPHERE'
THIN_ATMOSPHERE = 'THIN_ATMOSPHERE'
JOVIAN = 'JOVIAN'
ROCKY = 'ROCKY'
VOLCANIC = 'VOLCANIC'
FROZEN = 'FROZEN'
SWAMP = 'SWAMP'
BARREN = 'BARREN'
TEMPERATE = 'TEMPERATE'
JUNGLE = 'JUNGLE'
OCEAN = 'OCEAN'
RADIOACTIVE = 'RADIOACTIVE'
MICRO_GRAVITY_ANOMALIES = 'MICRO_GRAVITY_ANOMALIES'
DEBRIS_CLUSTER = 'DEBRIS_CLUSTER'
DEEP_CRATERS = 'DEEP_CRATERS'
SHALLOW_CRATERS = 'SHALLOW_CRATERS'
UNSTABLE_COMPOSITION = 'UNSTABLE_COMPOSITION'
HOLLOWED_INTERIOR = 'HOLLOWED_INTERIOR'
STRIPPED = 'STRIPPED'
@dataclasses.dataclass
class WaypointModifier:
# The unique identifier of the modifier.
symbol: WaypointModifierSymbol
# The name of the trait.
name: str
# A description of the trait.
description: str
class WaypointModifierSymbol(enum.Enum):
"""The unique identifier of the modifier."""
STRIPPED = 'STRIPPED'
UNSTABLE = 'UNSTABLE'
RADIATION_LEAK = 'RADIATION_LEAK'
CRITICAL_LIMIT = 'CRITICAL_LIMIT'
CIVIL_UNREST = 'CIVIL_UNREST'
@dataclasses.dataclass
class Chart:
"""The chart of a system or waypoint, which makes the location
visible to other agents.
"""
# The symbol of the waypoint.
waypoint_symbol: str
# The agent that submitted the chart for this waypoint.
submitted_by: str
# The time the chart for this waypoint was submitted.
submitted_on: dt.datetime
@dataclasses.dataclass
class Construction:
"""The construction details of a waypoint."""
# The symbol of the waypoint.
symbol: str
# The materials required to construct the waypoint.
materials: list[ConstructionMaterial]
# Whether the waypoint has been constructed.
is_complete: bool
@dataclasses.dataclass
class ConstructionMaterial:
"""The details of the required construction materials for a given
waypoint under construction.
"""
# The good's symbol.
trade_symbol: TradeSymbol
# The number of units required.
required: int
# The number of units fulfilled toward the required amount.
fulfilled: int
class TradeSymbol(enum.Enum):
"""The good's symbol."""
PRECIOUS_STONES = 'PRECIOUS_STONES'
QUARTZ_SAND = 'QUARTZ_SAND'
SILICON_CRYSTALS = 'SILICON_CRYSTALS'
AMMONIA_ICE = 'AMMONIA_ICE'
LIQUID_HYDROGEN = 'LIQUID_HYDROGEN'
LIQUID_NITROGEN = 'LIQUID_NITROGEN'
ICE_WATER = 'ICE_WATER'
EXOTIC_MATTER = 'EXOTIC_MATTER'
ADVANCED_CIRCUITRY = 'ADVANCED_CIRCUITRY'
GRAVITON_EMITTERS = 'GRAVITON_EMITTERS'
IRON = 'IRON'
IRON_ORE = 'IRON_ORE'
COPPER = 'COPPER'
COPPER_ORE = 'COPPER_ORE'
ALUMINUM = 'ALUMINUM'
ALUMINUM_ORE = 'ALUMINUM_ORE'
SILVER = 'SILVER'
SILVER_ORE = 'SILVER_ORE'
GOLD = 'GOLD'
GOLD_ORE = 'GOLD_ORE'
PLATINUM = 'PLATINUM'
PLATINUM_ORE = 'PLATINUM_ORE'
DIAMONDS = 'DIAMONDS'
URANITE = 'URANITE'
URANITE_ORE = 'URANITE_ORE'
MERITIUM = 'MERITIUM'
MERITIUM_ORE = 'MERITIUM_ORE'
HYDROCARBON = 'HYDROCARBON'
ANTIMATTER = 'ANTIMATTER'
FAB_MATS = 'FAB_MATS'
FERTILIZERS = 'FERTILIZERS'
FABRICS = 'FABRICS'
FOOD = 'FOOD'
JEWELRY = 'JEWELRY'
MACHINERY = 'MACHINERY'
FIREARMS = 'FIREARMS'
ASSAULT_RIFLES = 'ASSAULT_RIFLES'
MILITARY_EQUIPMENT = 'MILITARY_EQUIPMENT'
EXPLOSIVES = 'EXPLOSIVES'
LAB_INSTRUMENTS = 'LAB_INSTRUMENTS'
AMMUNITION = 'AMMUNITION'
ELECTRONICS = 'ELECTRONICS'
SHIP_PLATING = 'SHIP_PLATING'
SHIP_PARTS = 'SHIP_PARTS'
EQUIPMENT = 'EQUIPMENT'
FUEL = 'FUEL'
MEDICINE = 'MEDICINE'
DRUGS = 'DRUGS'
CLOTHING = 'CLOTHING'
MICROPROCESSORS = 'MICROPROCESSORS'
PLASTICS = 'PLASTICS'
POLYNUCLEOTIDES = 'POLYNUCLEOTIDES'
BIOCOMPOSITES = 'BIOCOMPOSITES'
QUANTUM_STABILIZERS = 'QUANTUM_STABILIZERS'
NANOBOTS = 'NANOBOTS'
AI_MAINFRAMES = 'AI_MAINFRAMES'
QUANTUM_DRIVES = 'QUANTUM_DRIVES'
ROBOTIC_DRONES = 'ROBOTIC_DRONES'
CYBER_IMPLANTS = 'CYBER_IMPLANTS'
GENE_THERAPEUTICS = 'GENE_THERAPEUTICS'
NEURAL_CHIPS = 'NEURAL_CHIPS'
MOOD_REGULATORS = 'MOOD_REGULATORS'
VIRAL_AGENTS = 'VIRAL_AGENTS'
MICRO_FUSION_GENERATORS = 'MICRO_FUSION_GENERATORS'
SUPERGRAINS = 'SUPERGRAINS'
LASER_RIFLES = 'LASER_RIFLES'
HOLOGRAPHICS = 'HOLOGRAPHICS'
SHIP_SALVAGE = 'SHIP_SALVAGE'
RELIC_TECH = 'RELIC_TECH'
NOVEL_LIFEFORMS = 'NOVEL_LIFEFORMS'
BOTANICAL_SPECIMENS = 'BOTANICAL_SPECIMENS'
CULTURAL_ARTIFACTS = 'CULTURAL_ARTIFACTS'
FRAME_PROBE = 'FRAME_PROBE'
FRAME_DRONE = 'FRAME_DRONE'
FRAME_INTERCEPTOR = 'FRAME_INTERCEPTOR'
FRAME_RACER = 'FRAME_RACER'
FRAME_FIGHTER = 'FRAME_FIGHTER'
FRAME_FRIGATE = 'FRAME_FRIGATE'
FRAME_SHUTTLE = 'FRAME_SHUTTLE'
FRAME_EXPLORER = 'FRAME_EXPLORER'
FRAME_MINER = 'FRAME_MINER'
FRAME_LIGHT_FREIGHTER = 'FRAME_LIGHT_FREIGHTER'
FRAME_HEAVY_FREIGHTER = 'FRAME_HEAVY_FREIGHTER'
FRAME_TRANSPORT = 'FRAME_TRANSPORT'
FRAME_DESTROYER = 'FRAME_DESTROYER'
FRAME_CRUISER = 'FRAME_CRUISER'
FRAME_CARRIER = 'FRAME_CARRIER'
FRAME_BULK_FREIGHTER = 'FRAME_BULK_FREIGHTER'
REACTOR_SOLAR_I = 'REACTOR_SOLAR_I'
REACTOR_FUSION_I = 'REACTOR_FUSION_I'
REACTOR_FISSION_I = 'REACTOR_FISSION_I'
REACTOR_CHEMICAL_I = 'REACTOR_CHEMICAL_I'
REACTOR_ANTIMATTER_I = 'REACTOR_ANTIMATTER_I'
ENGINE_IMPULSE_DRIVE_I = 'ENGINE_IMPULSE_DRIVE_I'
ENGINE_ION_DRIVE_I = 'ENGINE_ION_DRIVE_I'
ENGINE_ION_DRIVE_II = 'ENGINE_ION_DRIVE_II'
ENGINE_HYPER_DRIVE_I = 'ENGINE_HYPER_DRIVE_I'
MODULE_MINERAL_PROCESSOR_I = 'MODULE_MINERAL_PROCESSOR_I'
MODULE_GAS_PROCESSOR_I = 'MODULE_GAS_PROCESSOR_I'
MODULE_CARGO_HOLD_I = 'MODULE_CARGO_HOLD_I'
MODULE_CARGO_HOLD_II = 'MODULE_CARGO_HOLD_II'
MODULE_CARGO_HOLD_III = 'MODULE_CARGO_HOLD_III'
MODULE_CREW_QUARTERS_I = 'MODULE_CREW_QUARTERS_I'
MODULE_ENVOY_QUARTERS_I = 'MODULE_ENVOY_QUARTERS_I'
MODULE_PASSENGER_CABIN_I = 'MODULE_PASSENGER_CABIN_I'
MODULE_MICRO_REFINERY_I = 'MODULE_MICRO_REFINERY_I'
MODULE_SCIENCE_LAB_I = 'MODULE_SCIENCE_LAB_I'
MODULE_JUMP_DRIVE_I = 'MODULE_JUMP_DRIVE_I'
MODULE_JUMP_DRIVE_II = 'MODULE_JUMP_DRIVE_II'
MODULE_JUMP_DRIVE_III = 'MODULE_JUMP_DRIVE_III'
MODULE_WARP_DRIVE_I = 'MODULE_WARP_DRIVE_I'
MODULE_WARP_DRIVE_II = 'MODULE_WARP_DRIVE_II'
MODULE_WARP_DRIVE_III = 'MODULE_WARP_DRIVE_III'
MODULE_SHIELD_GENERATOR_I = 'MODULE_SHIELD_GENERATOR_I'
MODULE_SHIELD_GENERATOR_II = 'MODULE_SHIELD_GENERATOR_II'
MODULE_ORE_REFINERY_I = 'MODULE_ORE_REFINERY_I'
MODULE_FUEL_REFINERY_I = 'MODULE_FUEL_REFINERY_I'
MOUNT_GAS_SIPHON_I = 'MOUNT_GAS_SIPHON_I'
MOUNT_GAS_SIPHON_II = 'MOUNT_GAS_SIPHON_II'
MOUNT_GAS_SIPHON_III = 'MOUNT_GAS_SIPHON_III'
MOUNT_SURVEYOR_I = 'MOUNT_SURVEYOR_I'
MOUNT_SURVEYOR_II = 'MOUNT_SURVEYOR_II'
MOUNT_SURVEYOR_III = 'MOUNT_SURVEYOR_III'
MOUNT_SENSOR_ARRAY_I = 'MOUNT_SENSOR_ARRAY_I'
MOUNT_SENSOR_ARRAY_II = 'MOUNT_SENSOR_ARRAY_II'
MOUNT_SENSOR_ARRAY_III = 'MOUNT_SENSOR_ARRAY_III'
MOUNT_MINING_LASER_I = 'MOUNT_MINING_LASER_I'
MOUNT_MINING_LASER_II = 'MOUNT_MINING_LASER_II'
MOUNT_MINING_LASER_III = 'MOUNT_MINING_LASER_III'
MOUNT_LASER_CANNON_I = 'MOUNT_LASER_CANNON_I'
MOUNT_MISSILE_LAUNCHER_I = 'MOUNT_MISSILE_LAUNCHER_I'
MOUNT_TURRET_I = 'MOUNT_TURRET_I'
SHIP_PROBE = 'SHIP_PROBE'
SHIP_MINING_DRONE = 'SHIP_MINING_DRONE'
SHIP_SIPHON_DRONE = 'SHIP_SIPHON_DRONE'
SHIP_INTERCEPTOR = 'SHIP_INTERCEPTOR'
SHIP_LIGHT_HAULER = 'SHIP_LIGHT_HAULER'
SHIP_COMMAND_FRIGATE = 'SHIP_COMMAND_FRIGATE'
SHIP_EXPLORER = 'SHIP_EXPLORER'
SHIP_HEAVY_FREIGHTER = 'SHIP_HEAVY_FREIGHTER'
SHIP_LIGHT_SHUTTLE = 'SHIP_LIGHT_SHUTTLE'
SHIP_ORE_HOUND = 'SHIP_ORE_HOUND'
SHIP_REFINING_FREIGHTER = 'SHIP_REFINING_FREIGHTER'
SHIP_SURVEYOR = 'SHIP_SURVEYOR'
SHIP_BULK_FREIGHTER = 'SHIP_BULK_FREIGHTER'
@dataclasses.dataclass
class ShipCargo:
"""Ship cargo details."""
# The max number of items that can be stored in the cargo hold.
capacity: int
# The number of items currently stored in the cargo hold.
units: int
# The items currently in the cargo hold.
inventory: list[ShipCargoItem]
@dataclasses.dataclass
class ShipCargoItem:
"""The type of cargo item and the number of units."""
# The good's symbol.
symbol: TradeSymbol
# The name of the cargo item type.
name: str
# The description of the cargo item type.
description: str
# The number of units of the cargo item.
units: int
@dataclasses.dataclass
class Market:
"""Market details."""
# The symbol of the market. The symbol is the same as the waypoint
# where the market is located.
symbol: str
# The list of goods that are exported from this market.
exports: list[TradeGood]
# The list of goods that are sought as imports in this market.
imports: list[TradeGood]
# The list of goods that are bought and sold between agents at
# this market.
exchange: list[TradeGood]
# The list of recent transactions at this market. Visible only
# when a ship is present at the market.
transactions: list[MarketTransaction] | None = None
# The list of goods that are traded at this market. Visible only
# when a ship is present at the market.
trade_goods: list[MarketTradeGood] | None = None
@dataclasses.dataclass
class TradeGood:
"""A good that can be traded for other goods or currency."""
# The good's symbol.
symbol: TradeSymbol
# The name of the good.
name: str
# The description of the good.
description: str
@dataclasses.dataclass
class MarketTransaction:
"""Result of a transaction with a market."""
class Type(enum.Enum):
"""The type of transaction."""
PURCHASE = 'PURCHASE'
SELL = 'SELL'
# The symbol of the waypoint.
waypoint_symbol: str
# The symbol of the ship that made the transaction.
ship_symbol: str
# The symbol of the trade good.
trade_symbol: str
# The type of transaction.
type: Type
# The number of units of the transaction.
units: int
# The price per unit of the transaction.
price_per_unit: int
# The total price of the transaction.
total_price: int
# The timestamp of the transaction.
timestamp: dt.datetime
@dataclasses.dataclass
class MarketTradeGood:
class Type(enum.Enum):
"""The type of trade good (export, import, or exchange)."""
EXPORT = 'EXPORT'
IMPORT = 'IMPORT'
EXCHANGE = 'EXCHANGE'
# The good's symbol.
symbol: TradeSymbol
# The type of trade good (export, import, or exchange).
type: Type
# This is the maximum number of units that can be purchased or
# sold at this market in a single trade for this good. Trade
# volume also gives an indication of price volatility. A market
# with a low trade volume will have large price swings, while high
# trade volume will be more resilient to price changes.
trade_volume: int
# The supply level of a trade good.
supply: SupplyLevel
# The price at which this good can be purchased from the market.
purchase_price: int
# The price at which this good can be sold to the market.
sell_price: int
# The activity level of a trade good. If the good is an import,
# this represents how strong consumption is. If the good is an
# export, this represents how strong the production is for the
# good. When activity is strong, consumption or production is near
# maximum capacity. When activity is weak, consumption or
# production is near minimum capacity.
activity: ActivityLevel | None = None
class SupplyLevel(enum.Enum):
"""The supply level of a trade good."""
SCARCE = 'SCARCE'
LIMITED = 'LIMITED'
MODERATE = 'MODERATE'
HIGH = 'HIGH'
ABUNDANT = 'ABUNDANT'
class ActivityLevel(enum.Enum):
"""The activity level of a trade good. If the good is an import,
this represents how strong consumption is. If the good is an
export, this represents how strong the production is for the good.
When activity is strong, consumption or production is near maximum
capacity. When activity is weak, consumption or production is near
minimum capacity.
"""
WEAK = 'WEAK'
GROWING = 'GROWING'
STRONG = 'STRONG'
RESTRICTED = 'RESTRICTED'
@dataclasses.dataclass
class JumpGate:
"""Details of a jump gate waypoint."""
# The symbol of the waypoint.
symbol: str
# All the gates that are connected to this waypoint.
connections: list[str]
@dataclasses.dataclass
class Shipyard:
"""Shipyard details."""
@dataclasses.dataclass
class ShipType:
# Type of ship
type: ShipType
# The symbol of the shipyard. The symbol is the same as the
# waypoint where the shipyard is located.
symbol: str
# The list of ship types available for purchase at this shipyard.
ship_types: list[ShipType]
# The fee to modify a ship at this shipyard. This includes
# installing or removing modules and mounts on a ship. In the case
# of mounts, the fee is a flat rate per mount. In the case of
# modules, the fee is per slot the module occupies.
modifications_fee: int
# The list of recent transactions at this shipyard.
transactions: list[ShipyardTransaction] | None = None
# The ships that are currently available for purchase at the
# shipyard.
ships: list[ShipyardShip] | None = None
class ShipType(enum.Enum):
"""Type of ship"""
PROBE = 'SHIP_PROBE'
MINING_DRONE = 'SHIP_MINING_DRONE'
SIPHON_DRONE = 'SHIP_SIPHON_DRONE'
INTERCEPTOR = 'SHIP_INTERCEPTOR'
LIGHT_HAULER = 'SHIP_LIGHT_HAULER'
COMMAND_FRIGATE = 'SHIP_COMMAND_FRIGATE'
EXPLORER = 'SHIP_EXPLORER'
HEAVY_FREIGHTER = 'SHIP_HEAVY_FREIGHTER'
LIGHT_SHUTTLE = 'SHIP_LIGHT_SHUTTLE'
ORE_HOUND = 'SHIP_ORE_HOUND'
REFINING_FREIGHTER = 'SHIP_REFINING_FREIGHTER'
SURVEYOR = 'SHIP_SURVEYOR'
BULK_FREIGHTER = 'SHIP_BULK_FREIGHTER'
@dataclasses.dataclass
class ShipyardTransaction:
"""Results of a transaction with a shipyard."""
# The symbol of the waypoint.
waypoint_symbol: str
# The symbol of the ship type (e.g. SHIP_MINING_DRONE) that was
# the subject of the transaction. Contrary to what the name
# implies, this is NOT the symbol of the ship that was purchased.
ship_symbol: str
# The symbol of the ship type (e.g. SHIP_MINING_DRONE) that was
# the subject of the transaction.
ship_type: str
# The price of the transaction.
price: int
# The symbol of the agent that made the transaction.
agent_symbol: str
# The timestamp of the transaction.
timestamp: dt.datetime
@dataclasses.dataclass
class ShipyardShip:
"""Ship details available at a shipyard."""
@dataclasses.dataclass
class Crew:
# The minimum number of crew members required to maintain the
# ship.
required: int
# The maximum number of crew members the ship can support.
capacity: int
# Type of ship
type: ShipType
# Name of the ship.
name: str
# Description of the ship.
description: str
# The supply level of a trade good.
supply: SupplyLevel
# The purchase price of the ship.
purchase_price: int
# The frame of the ship. The frame determines the number of
# modules and mounting points of the ship, as well as base fuel
# capacity. As the condition of the frame takes more wear, the
# ship will become more sluggish and less maneuverable.
frame: ShipFrame
# The reactor of the ship. The reactor is responsible for powering
# the ship's systems and weapons.
reactor: ShipReactor
# The engine determines how quickly a ship travels between
# waypoints.
engine: ShipEngine
# Modules installed in this ship.
modules: list[ShipModule]
# Mounts installed in this ship.
mounts: list[ShipMount]
crew: Crew
# The activity level of a trade good. If the good is an import,
# this represents how strong consumption is. If the good is an
# export, this represents how strong the production is for the
# good. When activity is strong, consumption or production is near
# maximum capacity. When activity is weak, consumption or
# production is near minimum capacity.
activity: ActivityLevel | None = None
@dataclasses.dataclass
class ShipFrame:
"""The frame of the ship. The frame determines the number of
modules and mounting points of the ship, as well as base fuel
capacity. As the condition of the frame takes more wear, the ship
will become more sluggish and less maneuverable.
"""
class Symbol(enum.Enum):
"""Symbol of the frame."""
PROBE = 'FRAME_PROBE'
DRONE = 'FRAME_DRONE'
INTERCEPTOR = 'FRAME_INTERCEPTOR'
RACER = 'FRAME_RACER'
FIGHTER = 'FRAME_FIGHTER'
FRIGATE = 'FRAME_FRIGATE'
SHUTTLE = 'FRAME_SHUTTLE'
EXPLORER = 'FRAME_EXPLORER'
MINER = 'FRAME_MINER'
LIGHT_FREIGHTER = 'FRAME_LIGHT_FREIGHTER'
HEAVY_FREIGHTER = 'FRAME_HEAVY_FREIGHTER'
TRANSPORT = 'FRAME_TRANSPORT'
DESTROYER = 'FRAME_DESTROYER'
CRUISER = 'FRAME_CRUISER'
CARRIER = 'FRAME_CARRIER'
BULK_FREIGHTER = 'FRAME_BULK_FREIGHTER'
# Symbol of the frame.
symbol: Symbol
# Name of the frame.
name: str
# The repairable condition of a component. A value of 0 indicates
# the component needs significant repairs, while a value of 1
# indicates the component is in near perfect condition. As the
# condition of a component is repaired, the overall integrity of
# the component decreases.
condition: float
# The overall integrity of the component, which determines the
# performance of the component. A value of 0 indicates that the
# component is almost completely degraded, while a value of 1
# indicates that the component is in near perfect condition. The
# integrity of the component is non-repairable, and represents
# permanent wear over time.
integrity: float
# Description of the frame.
description: str
# The amount of slots that can be dedicated to modules installed
# in the ship. Each installed module take up a number of slots,
# and once there are no more slots, no new modules can be
# installed.
module_slots: int
# The amount of slots that can be dedicated to mounts installed in
# the ship. Each installed mount takes up a number of points, and
# once there are no more points remaining, no new mounts can be
# installed.
mounting_points: int
# The maximum amount of fuel that can be stored in this ship. When
# refueling, the ship will be refueled to this amount.
fuel_capacity: int
# The requirements for installation on a ship
requirements: ShipRequirements
# The overall quality of the component, which determines the
# quality of the component. High quality components return more
# ships parts and ship plating when a ship is scrapped. But also
# require more of these parts to repair. This is transparent to
# the player, as the parts are bought from/sold to the
# marketplace.
quality: float
@dataclasses.dataclass
class ShipRequirements:
"""The requirements for installation on a ship"""
# The amount of power required from the reactor.
power: int | None = None
# The number of crew required for operation.
crew: int | None = None
# The number of module slots required for installation.
slots: int | None = None
@dataclasses.dataclass
class ShipReactor:
"""The reactor of the ship. The reactor is responsible for
powering the ship's systems and weapons.
"""
class Symbol(enum.Enum):
"""Symbol of the reactor."""
SOLAR_I = 'REACTOR_SOLAR_I'
FUSION_I = 'REACTOR_FUSION_I'
FISSION_I = 'REACTOR_FISSION_I'
CHEMICAL_I = 'REACTOR_CHEMICAL_I'
ANTIMATTER_I = 'REACTOR_ANTIMATTER_I'
# Symbol of the reactor.
symbol: Symbol
# Name of the reactor.
name: str
# The repairable condition of a component. A value of 0 indicates
# the component needs significant repairs, while a value of 1
# indicates the component is in near perfect condition. As the
# condition of a component is repaired, the overall integrity of
# the component decreases.
condition: float
# The overall integrity of the component, which determines the
# performance of the component. A value of 0 indicates that the
# component is almost completely degraded, while a value of 1
# indicates that the component is in near perfect condition. The
# integrity of the component is non-repairable, and represents
# permanent wear over time.
integrity: float
# Description of the reactor.
description: str
# The amount of power provided by this reactor. The more power a
# reactor provides to the ship, the lower the cooldown it gets
# when using a module or mount that taxes the ship's power.
power_output: int
# The requirements for installation on a ship
requirements: ShipRequirements
# The overall quality of the component, which determines the
# quality of the component. High quality components return more
# ships parts and ship plating when a ship is scrapped. But also
# require more of these parts to repair. This is transparent to
# the player, as the parts are bought from/sold to the
# marketplace.
quality: float
@dataclasses.dataclass
class ShipEngine:
"""The engine determines how quickly a ship travels between
waypoints.
"""
class Symbol(enum.Enum):
"""The symbol of the engine."""
IMPULSE_DRIVE_I = 'ENGINE_IMPULSE_DRIVE_I'
ION_DRIVE_I = 'ENGINE_ION_DRIVE_I'
ION_DRIVE_II = 'ENGINE_ION_DRIVE_II'
HYPER_DRIVE_I = 'ENGINE_HYPER_DRIVE_I'
# The symbol of the engine.
symbol: Symbol
# The name of the engine.
name: str
# The repairable condition of a component. A value of 0 indicates
# the component needs significant repairs, while a value of 1
# indicates the component is in near perfect condition. As the
# condition of a component is repaired, the overall integrity of
# the component decreases.
condition: float
# The overall integrity of the component, which determines the
# performance of the component. A value of 0 indicates that the
# component is almost completely degraded, while a value of 1
# indicates that the component is in near perfect condition. The
# integrity of the component is non-repairable, and represents
# permanent wear over time.
integrity: float
# The description of the engine.
description: str
# The speed stat of this engine. The higher the speed, the faster
# a ship can travel from one point to another. Reduces the time of
# arrival when navigating the ship.
speed: int
# The requirements for installation on a ship
requirements: ShipRequirements
# The overall quality of the component, which determines the
# quality of the component. High quality components return more
# ships parts and ship plating when a ship is scrapped. But also
# require more of these parts to repair. This is transparent to
# the player, as the parts are bought from/sold to the
# marketplace.
quality: float
@dataclasses.dataclass
class ShipModule:
"""A module can be installed in a ship and provides a set of
capabilities such as storage space or quarters for crew. Module
installations are permanent.
"""
class Symbol(enum.Enum):
"""The symbol of the module."""
MINERAL_PROCESSOR_I = 'MODULE_MINERAL_PROCESSOR_I'
GAS_PROCESSOR_I = 'MODULE_GAS_PROCESSOR_I'
CARGO_HOLD_I = 'MODULE_CARGO_HOLD_I'
CARGO_HOLD_II = 'MODULE_CARGO_HOLD_II'
CARGO_HOLD_III = 'MODULE_CARGO_HOLD_III'
CREW_QUARTERS_I = 'MODULE_CREW_QUARTERS_I'
ENVOY_QUARTERS_I = 'MODULE_ENVOY_QUARTERS_I'
PASSENGER_CABIN_I = 'MODULE_PASSENGER_CABIN_I'
MICRO_REFINERY_I = 'MODULE_MICRO_REFINERY_I'
ORE_REFINERY_I = 'MODULE_ORE_REFINERY_I'
FUEL_REFINERY_I = 'MODULE_FUEL_REFINERY_I'
SCIENCE_LAB_I = 'MODULE_SCIENCE_LAB_I'
JUMP_DRIVE_I = 'MODULE_JUMP_DRIVE_I'
JUMP_DRIVE_II = 'MODULE_JUMP_DRIVE_II'
JUMP_DRIVE_III = 'MODULE_JUMP_DRIVE_III'
WARP_DRIVE_I = 'MODULE_WARP_DRIVE_I'
WARP_DRIVE_II = 'MODULE_WARP_DRIVE_II'
WARP_DRIVE_III = 'MODULE_WARP_DRIVE_III'
SHIELD_GENERATOR_I = 'MODULE_SHIELD_GENERATOR_I'
SHIELD_GENERATOR_II = 'MODULE_SHIELD_GENERATOR_II'
# The symbol of the module.
symbol: Symbol
# Name of this module.
name: str
# Description of this module.
description: str
# The requirements for installation on a ship
requirements: ShipRequirements
# Modules that provide capacity, such as cargo hold or crew
# quarters will show this value to denote how much of a bonus the
# module grants.
capacity: int | None = None
# Modules that have a range will such as a sensor array show this
# value to denote how far can the module reach with its
# capabilities.
range: int | None = None
@dataclasses.dataclass
class ShipMount:
"""A mount is installed on the exterier of a ship."""
class Symbol(enum.Enum):
"""Symbol of this mount."""
GAS_SIPHON_I = 'MOUNT_GAS_SIPHON_I'
GAS_SIPHON_II = 'MOUNT_GAS_SIPHON_II'
GAS_SIPHON_III = 'MOUNT_GAS_SIPHON_III'
SURVEYOR_I = 'MOUNT_SURVEYOR_I'
SURVEYOR_II = 'MOUNT_SURVEYOR_II'
SURVEYOR_III = 'MOUNT_SURVEYOR_III'
SENSOR_ARRAY_I = 'MOUNT_SENSOR_ARRAY_I'
SENSOR_ARRAY_II = 'MOUNT_SENSOR_ARRAY_II'
SENSOR_ARRAY_III = 'MOUNT_SENSOR_ARRAY_III'
MINING_LASER_I = 'MOUNT_MINING_LASER_I'
MINING_LASER_II = 'MOUNT_MINING_LASER_II'
MINING_LASER_III = 'MOUNT_MINING_LASER_III'
LASER_CANNON_I = 'MOUNT_LASER_CANNON_I'
MISSILE_LAUNCHER_I = 'MOUNT_MISSILE_LAUNCHER_I'
TURRET_I = 'MOUNT_TURRET_I'
class Deposit(enum.Enum):
QUARTZ_SAND = 'QUARTZ_SAND'
SILICON_CRYSTALS = 'SILICON_CRYSTALS'
PRECIOUS_STONES = 'PRECIOUS_STONES'
ICE_WATER = 'ICE_WATER'
AMMONIA_ICE = 'AMMONIA_ICE'
IRON_ORE = 'IRON_ORE'
COPPER_ORE = 'COPPER_ORE'
SILVER_ORE = 'SILVER_ORE'
ALUMINUM_ORE = 'ALUMINUM_ORE'
GOLD_ORE = 'GOLD_ORE'
PLATINUM_ORE = 'PLATINUM_ORE'
DIAMONDS = 'DIAMONDS'
URANITE_ORE = 'URANITE_ORE'
MERITIUM_ORE = 'MERITIUM_ORE'
# Symbol of this mount.
symbol: Symbol
# Name of this mount.
name: str
# Description of this mount.
description: str
# The requirements for installation on a ship
requirements: ShipRequirements
# Mounts that have this value, such as mining lasers, denote how
# powerful this mount's capabilities are.
strength: int | None = None
# Mounts that have this value denote what goods can be produced
# from using the mount.
deposits: list[Deposit] | None = None
@dataclasses.dataclass
class Contract:
"""Contract details."""
class Type(enum.Enum):
"""Type of contract."""
PROCUREMENT = 'PROCUREMENT'
TRANSPORT = 'TRANSPORT'
SHUTTLE = 'SHUTTLE'
# ID of the contract.
id: str
# The symbol of the faction that this contract is for.
faction_symbol: str
# Type of contract.
type: Type
# The terms to fulfill the contract.
terms: ContractTerms
# Whether the contract has been accepted by the agent
accepted: bool
# Whether the contract has been fulfilled
fulfilled: bool
# Deprecated in favor of deadlineToAccept
expiration: dt.datetime
# The time at which the contract is no longer available to be
# accepted
deadline_to_accept: dt.datetime | None = None
@dataclasses.dataclass
class ContractTerms:
"""The terms to fulfill the contract."""
# The deadline for the contract.
deadline: dt.datetime
# Payments for the contract.
payment: ContractPayment
# The cargo that needs to be delivered to fulfill the contract.
deliver: list[ContractDeliverGood] | None = None
@dataclasses.dataclass
class ContractPayment:
"""Payments for the contract."""
# The amount of credits received up front for accepting the
# contract.
on_accepted: int
# The amount of credits received when the contract is fulfilled.
on_fulfilled: int
@dataclasses.dataclass
class ContractDeliverGood:
"""The details of a delivery contract. Includes the type of good,
units needed, and the destination.
"""
# The symbol of the trade good to deliver.
trade_symbol: str
# The destination where goods need to be delivered.
destination_symbol: str
# The number of units that need to be delivered on this contract.
units_required: int
# The number of units fulfilled on this contract.
units_fulfilled: int
@dataclasses.dataclass
class Agent:
"""Agent details."""
# Account ID that is tied to this agent. Only included on your own
# agent.
account_id: str
# Symbol of the agent.
symbol: str
# The headquarters of the agent.
headquarters: str
# The number of credits the agent has available. Credits can be
# negative if funds have been overdrawn.
credits: int
# The faction the agent started with.
starting_faction: str
# How many ships are owned by the agent.
ship_count: int
@dataclasses.dataclass
class AgentEvent:
"""Agent event details."""
id: str
type: str
message: str
created_at: dt.datetime
data: typing.Any | None = None
@dataclasses.dataclass
class Ship:
"""Ship details."""
# The globally unique identifier of the ship in the following
# format: `[AGENT_SYMBOL]-[HEX_ID]`
symbol: str
# The public registration information of the ship
registration: ShipRegistration
# The navigation information of the ship.
nav: ShipNav
# The ship's crew service and maintain the ship's systems and
# equipment.
crew: ShipCrew
# The frame of the ship. The frame determines the number of
# modules and mounting points of the ship, as well as base fuel
# capacity. As the condition of the frame takes more wear, the
# ship will become more sluggish and less maneuverable.
frame: ShipFrame
# The reactor of the ship. The reactor is responsible for powering
# the ship's systems and weapons.
reactor: ShipReactor
# The engine determines how quickly a ship travels between
# waypoints.
engine: ShipEngine
# Modules installed in this ship.
modules: list[ShipModule]
# Mounts installed in this ship.
mounts: list[ShipMount]
# Ship cargo details.
cargo: ShipCargo
# Details of the ship's fuel tanks including how much fuel was
# consumed during the last transit or action.
fuel: ShipFuel
# A cooldown is a period of time in which a ship cannot perform
# certain actions.
cooldown: Cooldown
@dataclasses.dataclass
class ShipRegistration:
"""The public registration information of the ship"""
# The agent's registered name of the ship
name: str
# The symbol of the faction the ship is registered with
faction_symbol: str
# The registered role of the ship
role: ShipRole
class ShipRole(enum.Enum):
"""The registered role of the ship"""
FABRICATOR = 'FABRICATOR'
HARVESTER = 'HARVESTER'
HAULER = 'HAULER'
INTERCEPTOR = 'INTERCEPTOR'
EXCAVATOR = 'EXCAVATOR'
TRANSPORT = 'TRANSPORT'
REPAIR = 'REPAIR'
SURVEYOR = 'SURVEYOR'
COMMAND = 'COMMAND'
CARRIER = 'CARRIER'
PATROL = 'PATROL'
SATELLITE = 'SATELLITE'
EXPLORER = 'EXPLORER'
REFINERY = 'REFINERY'
@dataclasses.dataclass
class ShipNav:
"""The navigation information of the ship."""
# The symbol of the system.
system_symbol: str
# The symbol of the waypoint.
waypoint_symbol: str
# The routing information for the ship's most recent transit or
# current location.
route: ShipNavRoute
# The current status of the ship
status: ShipNavStatus
# The ship's set speed when traveling between waypoints or
# systems.
flight_mode: ShipNavFlightMode
@dataclasses.dataclass
class ShipNavRoute:
"""The routing information for the ship's most recent transit or
current location.
"""
# The destination or departure of a ships nav route.
destination: ShipNavRouteWaypoint
# The destination or departure of a ships nav route.
origin: ShipNavRouteWaypoint
# The date time of the ship's departure.
departure_time: dt.datetime
# The date time of the ship's arrival. If the ship is in-transit,
# this is the expected time of arrival.
arrival: dt.datetime
@dataclasses.dataclass
class ShipNavRouteWaypoint:
"""The destination or departure of a ships nav route."""
# The symbol of the waypoint.
symbol: str
# The type of waypoint.
type: WaypointType
# The symbol of the system.
system_symbol: str
# Position in the universe in the x axis.
x: int
# Position in the universe in the y axis.
y: int
class ShipNavStatus(enum.Enum):
"""The current status of the ship"""
IN_TRANSIT = 'IN_TRANSIT'
IN_ORBIT = 'IN_ORBIT'
DOCKED = 'DOCKED'
class ShipNavFlightMode(enum.Enum):
"""The ship's set speed when traveling between waypoints or
systems.
"""
DRIFT = 'DRIFT'
STEALTH = 'STEALTH'
CRUISE = 'CRUISE'
BURN = 'BURN'
@dataclasses.dataclass
class ShipCrew:
"""The ship's crew service and maintain the ship's systems and
equipment.
"""
class Rotation(enum.Enum):
"""The rotation of crew shifts. A stricter shift improves the
ship's performance. A more relaxed shift improves the crew's
morale.
"""
STRICT = 'STRICT'
RELAXED = 'RELAXED'
# The current number of crew members on the ship.
current: int
# The minimum number of crew members required to maintain the
# ship.
required: int
# The maximum number of crew members the ship can support.
capacity: int
# The rotation of crew shifts. A stricter shift improves the
# ship's performance. A more relaxed shift improves the crew's
# morale.
rotation: Rotation
# A rough measure of the crew's morale. A higher morale means the
# crew is happier and more productive. A lower morale means the
# ship is more prone to accidents.
morale: int
# The amount of credits per crew member paid per hour. Wages are
# paid when a ship docks at a civilized waypoint.
wages: int
@dataclasses.dataclass
class ShipFuel:
"""Details of the ship's fuel tanks including how much fuel was
consumed during the last transit or action.
"""
@dataclasses.dataclass
class Consumed:
"""An object that only shows up when an action has consumed
fuel in the process. Shows the fuel consumption data.
"""
# The amount of fuel consumed by the most recent transit or
# action.
amount: int
# The time at which the fuel was consumed.
timestamp: dt.datetime
# The current amount of fuel in the ship's tanks.
current: int
# The maximum amount of fuel the ship's tanks can hold.
capacity: int
# An object that only shows up when an action has consumed fuel in
# the process. Shows the fuel consumption data.
consumed: Consumed | None = None
@dataclasses.dataclass
class Cooldown:
"""A cooldown is a period of time in which a ship cannot perform
certain actions.
"""
# The symbol of the ship that is on cooldown
ship_symbol: str
# The total duration of the cooldown in seconds
total_seconds: int
# The remaining duration of the cooldown in seconds
remaining_seconds: int
# The date and time when the cooldown expires in ISO 8601 format
expiration: dt.datetime | None = None
@dataclasses.dataclass
class ChartTransaction:
"""Result of a chart transaction."""
# The symbol of the waypoint.
waypoint_symbol: str
# The symbol of the ship.
ship_symbol: str
# The total price of the transaction.
total_price: int
# The timestamp of the transaction.
timestamp: dt.datetime
@dataclasses.dataclass
class Extraction:
"""Extraction details."""
# Symbol of the ship that executed the extraction.
ship_symbol: str
# A yield from the extraction operation.
yield_: ExtractionYield
@dataclasses.dataclass
class ExtractionYield:
"""A yield from the extraction operation."""
# The good's symbol.
symbol: TradeSymbol
# The number of units extracted that were placed into the ship's
# cargo hold.
units: int
@dataclasses.dataclass
class ShipConditionEvent:
"""An event that represents damage or wear to a ship's reactor,
frame, or engine, reducing the condition of the ship.
"""
class Symbol(enum.Enum):
"""The symbol of the event that occurred."""
REACTOR_OVERLOAD = 'REACTOR_OVERLOAD'
ENERGY_SPIKE_FROM_MINERAL = 'ENERGY_SPIKE_FROM_MINERAL'
SOLAR_FLARE_INTERFERENCE = 'SOLAR_FLARE_INTERFERENCE'
COOLANT_LEAK = 'COOLANT_LEAK'
POWER_DISTRIBUTION_FLUCTUATION = 'POWER_DISTRIBUTION_FLUCTUATION'
MAGNETIC_FIELD_DISRUPTION = 'MAGNETIC_FIELD_DISRUPTION'
HULL_MICROMETEORITE_STRIKES = 'HULL_MICROMETEORITE_STRIKES'
STRUCTURAL_STRESS_FRACTURES = 'STRUCTURAL_STRESS_FRACTURES'
CORROSIVE_MINERAL_CONTAMINATION = 'CORROSIVE_MINERAL_CONTAMINATION'
THERMAL_EXPANSION_MISMATCH = 'THERMAL_EXPANSION_MISMATCH'
VIBRATION_DAMAGE_FROM_DRILLING = 'VIBRATION_DAMAGE_FROM_DRILLING'
ELECTROMAGNETIC_FIELD_INTERFERENCE = 'ELECTROMAGNETIC_FIELD_INTERFERENCE'
IMPACT_WITH_EXTRACTED_DEBRIS = 'IMPACT_WITH_EXTRACTED_DEBRIS'
FUEL_EFFICIENCY_DEGRADATION = 'FUEL_EFFICIENCY_DEGRADATION'
COOLANT_SYSTEM_AGEING = 'COOLANT_SYSTEM_AGEING'
DUST_MICROABRASIONS = 'DUST_MICROABRASIONS'
THRUSTER_NOZZLE_WEAR = 'THRUSTER_NOZZLE_WEAR'
EXHAUST_PORT_CLOGGING = 'EXHAUST_PORT_CLOGGING'
BEARING_LUBRICATION_FADE = 'BEARING_LUBRICATION_FADE'
SENSOR_CALIBRATION_DRIFT = 'SENSOR_CALIBRATION_DRIFT'
HULL_MICROMETEORITE_DAMAGE = 'HULL_MICROMETEORITE_DAMAGE'
SPACE_DEBRIS_COLLISION = 'SPACE_DEBRIS_COLLISION'
THERMAL_STRESS = 'THERMAL_STRESS'
VIBRATION_OVERLOAD = 'VIBRATION_OVERLOAD'
PRESSURE_DIFFERENTIAL_STRESS = 'PRESSURE_DIFFERENTIAL_STRESS'
ELECTROMAGNETIC_SURGE_EFFECTS = 'ELECTROMAGNETIC_SURGE_EFFECTS'
ATMOSPHERIC_ENTRY_HEAT = 'ATMOSPHERIC_ENTRY_HEAT'
class Component(enum.Enum):
FRAME = 'FRAME'
REACTOR = 'REACTOR'
ENGINE = 'ENGINE'
# The symbol of the event that occurred.
symbol: Symbol
component: Component
# The name of the event.
name: str
# A description of the event.
description: str
@dataclasses.dataclass
class Survey:
"""A resource survey of a waypoint, detailing a specific
extraction location and the types of resources that can be found
there.
"""
# A unique signature for the location of this survey. This
# signature is verified when attempting an extraction using this
# survey.
signature: str
# The symbol of the waypoint that this survey is for.
symbol: str
# A list of deposits that can be found at this location. A ship
# will extract one of these deposits when using this survey in an
# extraction request. If multiple deposits of the same type are
# present, the chance of extracting that deposit is increased.
deposits: list[SurveyDeposit]
# The date and time when the survey expires. After this date and
# time, the survey will no longer be available for extraction.
expiration: dt.datetime
# The size of the deposit. This value indicates how much can be
# extracted from the survey before it is exhausted.
size: SurveySize
@dataclasses.dataclass
class SurveyDeposit:
"""A surveyed deposit of a mineral or resource available for
extraction.
"""
# The symbol of the deposit.
symbol: typing.Any
class SurveySize(enum.Enum):
"""The size of the deposit. This value indicates how much can be
extracted from the survey before it is exhausted.
"""
SMALL = 'SMALL'
MODERATE = 'MODERATE'
LARGE = 'LARGE'
@dataclasses.dataclass
class ScannedSystem:
"""Details of a system was that scanned."""
# Symbol of the system.
symbol: str
# Symbol of the system's sector.
sector_symbol: str
# The type of system.
type: SystemType
# Position in the universe in the x axis.
x: int
# Position in the universe in the y axis.
y: int
# The system's distance from the scanning ship.
distance: int
@dataclasses.dataclass
class ScannedWaypoint:
"""A waypoint that was scanned by a ship."""
# The symbol of the waypoint.
symbol: str
# The type of waypoint.
type: WaypointType
# The symbol of the system.
system_symbol: str
# Position in the universe in the x axis.
x: int
# Position in the universe in the y axis.
y: int
# List of waypoints that orbit this waypoint.
orbitals: list[WaypointOrbital]
# The traits of the waypoint.
traits: list[WaypointTrait]
# The faction that controls the waypoint.
faction: WaypointFaction | None = None
# The chart of a system or waypoint, which makes the location
# visible to other agents.
chart: Chart | None = None
@dataclasses.dataclass
class ScannedShip:
"""The ship that was scanned. Details include information about
the ship that could be detected by the scanner.
"""
@dataclasses.dataclass
class Frame:
"""The frame of the ship."""
# The symbol of the frame.
symbol: str
@dataclasses.dataclass
class Reactor:
"""The reactor of the ship."""
# The symbol of the reactor.
symbol: str
@dataclasses.dataclass
class Engine:
"""The engine of the ship."""
# The symbol of the engine.
symbol: str
@dataclasses.dataclass
class Mount:
# The symbol of the mount.
symbol: str
# The globally unique identifier of the ship.
symbol: str
# The public registration information of the ship
registration: ShipRegistration
# The navigation information of the ship.
nav: ShipNav
# The engine of the ship.
engine: Engine
# The frame of the ship.
frame: Frame | None = None
# The reactor of the ship.
reactor: Reactor | None = None
# List of mounts installed in the ship.
mounts: list[Mount] | None = None
@dataclasses.dataclass
class ScrapTransaction:
"""Result of a scrap transaction."""
# The symbol of the waypoint.
waypoint_symbol: str
# The symbol of the ship.
ship_symbol: str
# The total price of the transaction.
total_price: int
# The timestamp of the transaction.
timestamp: dt.datetime
@dataclasses.dataclass
class RepairTransaction:
"""Result of a repair transaction."""
# The symbol of the waypoint.
waypoint_symbol: str
# The symbol of the ship.
ship_symbol: str
# The total price of the transaction.
total_price: int
# The timestamp of the transaction.
timestamp: dt.datetime
@dataclasses.dataclass
class Siphon:
"""Siphon details."""
# Symbol of the ship that executed the siphon.
ship_symbol: str
# A yield from the siphon operation.
yield_: SiphonYield
@dataclasses.dataclass
class SiphonYield:
"""A yield from the siphon operation."""
# The good's symbol.
symbol: TradeSymbol
# The number of units siphoned that were placed into the ship's
# cargo hold.
units: int
@dataclasses.dataclass
class ShipModificationTransaction:
"""Result of a transaction for a ship modification, such as
installing a mount or a module.
"""
# The symbol of the waypoint where the transaction took place.
waypoint_symbol: str
# The symbol of the ship that made the transaction.
ship_symbol: str
# The symbol of the trade good.
trade_symbol: str
# The total price of the transaction.
total_price: int
# The timestamp of the transaction.
timestamp: dt.datetime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment