The ship_data module
Overview
API: ship data
alien_keys()
Get all keys in the ship data that contain "alien" in the key. Returns: list[str]: The list of keys.
arvonian_ship_keys()
Get all keys in the ship data for Arvonian ships. Returns: list[str]: The list of keys.
arvonian_starbase_keys()
Get all keys in the ship data for Arvonian starbases. Returns: list[str]: The list of keys.
asteroid_keys()
Get all asteroid keys in the ship data. Returns: list[str]: The list of keys.
container_keys()
Get all keys in the ship data that contian "container" in the key. Returns: list[str]: The list of keys.
crystal_asteroid_keys()
Get all crystal asteroid keys (excludes plain) in the ship data. Returns: list[str]: The list of keys.
danger_keys()
Get all keys in the ship data that contain "danger" in the key. Returns: list[str]: The list of keys.
filter_ship_data_by_side(test_ship_key, sides, role=None, ret_key_only=False)
Get a list of all ships with the given sides. Args: test_ship_key (str | None): Only include ship data for which the key includes this substring. sides (str): The comma-separated list of sides by which the ship data should be filtered. role (str, optional): An optional role by which the list may also be filtered. Must be a single role. ret_key_only (bool, optional): Should the returned list be a list of keys (if True), or a list of ship data entries (if False)? Returns: list[str | dict]: The list of keys or list of ship data entries.
get_ship_data()
Load the ship data, store it to the cache, and return it.
If the ship data is already in cache, returns it the cache contents instead of loading the file again.
Includes ship data from extraShipData.json for the current mission directory, if present.
Returns:
dict: The ship data dictionary.
get_ship_data_for(ship_key)
Get the ship data information for the ship with the given key. Args: ship_key (str): The key for the ship. Returns: dict: The ship data contents.
get_ship_index()
Get the ship data information and index it as a dictionary. Keys include: * individual ship keys * default sides Returns: dict: The indexed ship data information.
get_ship_name(ship_key)
Get the name of the ship with the specified key. Args: ship_key (str): The key for the ship. Returns: str | None: The name of the ship, or None.
kralien_ship_keys()
Get all keys in the ship data for Kralien ships. Returns: list[str]: The list of keys.
kralien_starbase_keys()
Get all keys in the ship data for Kralien starbases. Returns: list[str]: The list of keys.
merge_mod_ship_data(mod)
Get the ship data for the current mission, then adds the contents of extraShipData.json for the specified mission folder, if present, and adds it to the cache.
Returns:
dict: The ship data.
pirate_ship_keys()
Get all keys in the ship data for pirate ships. Returns: list[str]: The list of keys.
pirate_starbase_keys()
Get all keys in the ship data for pirate starbases. (As of 1.2.2, there were none.) Returns: list[str]: The list of keys.
plain_asteroid_keys()
Get all plain asteroid keys (excludes crystal) in the ship data. Returns: list[str]: The list of keys.
reset_ship_data_caches()
Clear the ship data cache. Use to remove mission ship data for other mission folders, or possibly to just clear out some memory usage if it won't be used.
skaraan_ship_keys()
Get all keys in the ship data for Skaraan ships. Returns: list[str]: The list of keys.
skaraan_starbase_keys()
Get all keys in the ship data for Skaraan starbases. Returns: list[str]: The list of keys.
terran_ship_keys()
Get all keys in the ship data for terran ships. Returns: list[str]: The list of keys.
terran_starbase_keys()
Get all keys in the ship data for terran starbases. Returns: list[str]: The list of keys.
torgoth_ship_keys()
Get all keys in the ship data for Torgoth ships. Returns: list[str]: The list of keys.
torgoth_starbase_keys()
Get all keys in the ship data for Torgoth starbases. Returns: list[str]: The list of keys.
ximni_ship_keys()
Get all keys in the ship data for Ximni ships. Returns: list[str]: The list of keys.
ximni_starbase_keys()
Get all keys in the ship data for Ximni starbases. Returns: list[str]: The list of keys.