src.api.adapters.repositories.satellite_repository module

class src.api.adapters.repositories.satellite_repository.AbstractSatelliteRepository[source]

Bases: ABC

__init__()[source]
_abc_impl = <_abc._abc_data object>
abstract _add(satellite: Satellite)[source]
abstract _get(satellite_id: str) Satellite | None[source]
abstract _get_active_satellites(object_type: str | None = None)[source]
abstract _get_norad_ids_from_satellite_name(name)[source]
abstract _get_satellite_data_by_id(id)[source]
abstract _get_satellite_data_by_name(name)[source]
abstract _get_satellite_names_from_norad_id(id)[source]
abstract _search_all_satellites(parameters: dict)[source]
add(satellite: Satellite)[source]
get(satellite_id: str) Satellite | None[source]
get_active_satellites(object_type: str | None = None)[source]
get_norad_ids_from_satellite_name(name)[source]
get_satellite_data_by_id(id)[source]
get_satellite_data_by_name(name)[source]
get_satellite_names_from_norad_id(id)[source]
search_all_satellites(parameters: dict)[source]
class src.api.adapters.repositories.satellite_repository.SqlAlchemySatelliteRepository[source]

Bases: AbstractSatelliteRepository

__init__(session)[source]
_abc_impl = <_abc._abc_data object>
_add(satellite: Satellite)[source]
_get(satellite_id: str) Satellite | None[source]
_get_active_satellites(object_type: str | None = None)[source]

Retrieves active satellites based on the provided object type (optional). Only returns satellites that are active (no decay date) and have current satellite numbers (to eliminate duplicates).

Parameters:
  • object_type (str) – The type of the object, either “payload”, “debris”,

  • body" ("rocket) –

  • "tba"

  • "unknown". (or) –

Returns:

A list of active satellites.

Return type:

List[SatelliteDb]

_get_norad_ids_from_satellite_name(name)[source]

Retrieves the NORAD IDs and the date the satellite was added to SatChecker for a given satellite name.

Parameters:

name (str) – The name of the satellite.

Returns:

A list of tuples, each containing the NORAD ID, date added, and a boolean indicating if it has the current satellite number.

Return type:

list of tuple

_get_satellite_data_by_id(id)[source]

Retrieves satellite data (rcs_size, launch date, etc. ) for a given NORAD ID.

This method queries the database to find a satellite with the specified NORAD ID that also has the current satellite number.

Parameters:

id (int) – The NORAD ID of the satellite.

Returns:

The satellite data if found, otherwise None.

Return type:

SatelliteDb

_get_satellite_data_by_name(name)[source]

Retrieves satellite data (rcs_size, launch date, etc. ) for a given satellite name.

This method queries the database to find a satellite with the specified name that also has the current satellite number.

Parameters:

name (str) – The name of the satellite.

Returns:

The satellite data if found, otherwise None.

Return type:

SatelliteDb

_get_satellite_names_from_norad_id(id)[source]

Retrieves the names and dates of satellites associated with a given NORAD ID.

Parameters:

id (int) – The NORAD ID of the satellite.

Returns:

A list of tuples, each containing the satellite name, date added, and a boolean indicating if it has the current satellite number.

Return type:

list of tuple

Retrieves unique Starlink generations with their earliest and most recent launch dates.

Parameters:

None

Returns:

A list of tuples containing (generation, earliest_launch_date, latest_launch_date)

Return type:

List[tuple]

_search_all_satellites(parameters: dict)[source]
static _to_domain(orm_satellite) Satellite | None[source]
static _to_orm(domain_satellite)[source]