Carrier Operations
Functions for managing energy carriers.
create_carrier
python
create_carrier((conn: sqlite3.Connection, name: str, co2_emissions: float = 0.0, color: Optional[str] = None, nice_name: Optional[str] = None) -> int)Create a carrier record and return carrier ID (single network per database).
Parameters:
conn: Database connectionname: Carrier nameco2_emissions: CO2 emissions factorcolor: Display colornice_name: Human-readable name
Returns:
ID of the newly created carrier
list_carriers
python
list_carriers((conn: sqlite3.Connection) -> List[pyconvexity.models.carriers.Carrier])List all carriers for the network (single network per database).
Parameters:
conn: Database connection
Returns:
List of Carrier objects ordered by name

