Package Documentation¶
Port Expenses API Package.
Classes:
Name | Description |
---|---|
PortExpensesAPI |
Represents Signal's Port Expenses API. |
Operation |
Enumeration of all possible operations. |
OperationStatus |
Enumeration of all possible operations statuses. |
EstimationStatus |
Enumeration of all possible estimation statuses. |
ItalianAnchorageDues |
Enumeration of all possible italian anchorage dues. |
PortExpenses |
The fees to be payed to port authorities. |
Port |
A maritime facility where vessels can dock. |
VesselType |
A vessel type. |
PortFilter |
A filter used to find specific ports. |
EstimationStatus
¶
Bases: Enum
An enumeration of all possible estimation statuses.
Source code in signal_ocean/port_expenses/enums.py
28 29 30 31 32 33 |
|
ItalianAnchorageDues
¶
Bases: Enum
An enumeration of all possible italian anchorage dues.
Source code in signal_ocean/port_expenses/enums.py
20 21 22 23 24 25 |
|
Operation
¶
Bases: Enum
An enumeration of all possible operations.
Source code in signal_ocean/port_expenses/enums.py
6 7 8 9 10 |
|
OperationStatus
¶
Bases: Enum
An enumeration of all possible operations statuses.
Source code in signal_ocean/port_expenses/enums.py
13 14 15 16 17 |
|
Port
dataclass
¶
A maritime facility where vessels can dock.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
ID of the port. |
name |
str
|
Name of the port. |
Source code in signal_ocean/port_expenses/models.py
47 48 49 50 51 52 53 54 55 56 57 |
|
PortExpenses
dataclass
¶
The fees for port's facilities and services.
Attributes:
Name | Type | Description |
---|---|---|
port_id |
int
|
Port ID |
towage |
int
|
Towage |
port_dues |
int
|
Port dues |
pilotage |
int
|
Pilotage |
agency_fees |
int
|
Agency fees |
other |
int
|
Other |
suez_dues |
int
|
Suez dues |
total_cost |
int
|
Total cost |
miscellaneous_dues |
int
|
Mischellaneous dues |
is_estimated |
bool
|
Flag for estimation |
canal_dues |
int
|
Canal dues |
berth_dues |
int
|
Berth dues |
lighthouse_dues |
int
|
Lighthouse dues |
mooring_unmooring |
int
|
Mooring-unmooring |
quay_dues |
int
|
Quay dues |
anchorage_dues |
int
|
Anchorage dues |
Source code in signal_ocean/port_expenses/models.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
PortExpensesAPI
¶
Represents Signal's Port Expenses API.
Source code in signal_ocean/port_expenses/port_expenses_api.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
__init__(connection=None)
¶
Initializes the Port Expenses API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connection
|
Optional[Connection]
|
API connection configuration. If not provided, the default connection method is used. |
None
|
Source code in signal_ocean/port_expenses/port_expenses_api.py
18 19 20 21 22 23 24 25 |
|
get_port_expenses(imo, port_id, vessel_type_id=None, estimated_time_of_berth=None, estimated_time_of_sail=None, operation=None, italian_anchorage_dues=None, cargo_type=None, operation_status=None, utc_date=None, historical_tce=None, estimation_status=None)
¶
Retrieves port expenses.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
imo
|
int
|
The vessel's IMO number. |
required |
port_id
|
int
|
ID of the port to retrieve the expenses for. |
required |
vessel_type_id
|
Optional[int]
|
Vessel type ID. |
None
|
estimated_time_of_berth
|
Optional[datetime]
|
Estimated time of berth. |
None
|
estimated_time_of_sail
|
Optional[datetime]
|
Estimated time of sail. |
None
|
operation
|
Optional[Operation]
|
Operation type. |
None
|
italian_anchorage_dues
|
Optional[ItalianAnchorageDues]
|
Italian anchorage dues. |
None
|
cargo_type
|
Optional[str]
|
Cargo type. |
None
|
operation_status
|
Optional[OperationStatus]
|
Operation status. |
None
|
utc_date
|
Optional[datetime]
|
UTC date. |
None
|
historical_tce
|
Optional[bool]
|
Flag for Historical TCE. |
None
|
estimation_status
|
Optional[EstimationStatus]
|
Estimation status. |
None
|
Returns:
Type | Description |
---|---|
Optional[PortExpenses]
|
The port expenses or None if a port with given ID does not exist or |
Optional[PortExpenses]
|
a vessel with the given IMO number does not exist. |
Source code in signal_ocean/port_expenses/port_expenses_api.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
get_port_model_vessel_expenses(port_id, vessel_type_id, formula_calculation_date, vessel_class_id=0, operation_status=OperationStatus.BALLAST, historical_tce=False, estimation_status=EstimationStatus.PRIORITY_TO_FORMULAS)
¶
Retrieves model vessel port expenses.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port_id
|
int
|
ID of the port to retrieve the expenses for. |
required |
vessel_type_id
|
int
|
Vessel type ID. |
required |
formula_calculation_date
|
datetime
|
Formula calculation date. |
required |
vessel_class_id
|
int
|
Vessel class ID. |
0
|
operation_status
|
OperationStatus
|
Operation status. |
BALLAST
|
historical_tce
|
bool
|
Flag for historical TCE. |
False
|
estimation_status
|
EstimationStatus
|
Estimation status. |
PRIORITY_TO_FORMULAS
|
Returns:
Type | Description |
---|---|
Optional[PortExpenses]
|
The port expenses for model vessel or None if a port with given ID |
Optional[PortExpenses]
|
does not exist or a vessel type with the given ID number does not |
Optional[PortExpenses]
|
exist. |
Source code in signal_ocean/port_expenses/port_expenses_api.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
get_ports(port_filter=None)
¶
Retrieves available ports.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port_filter
|
Optional[PortFilter]
|
A filter used to find specific ports. If not specified, returns all available ports. |
None
|
Returns:
Type | Description |
---|---|
Tuple[Port, ...]
|
A tuple of available ports that match the filter. |
Source code in signal_ocean/port_expenses/port_expenses_api.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
get_required_formula_parameters(port_id, vessel_type_id, calculation_date=None)
¶
Retrieves required formula parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port_id
|
int
|
ID of the port to retrieve the expenses for. |
required |
vessel_type_id
|
int
|
Vessel type ID. |
required |
calculation_date
|
Optional[datetime]
|
Calculation date. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
List of required port expenses formula calculation parameters. |
Source code in signal_ocean/port_expenses/port_expenses_api.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
get_vessel_types()
¶
Retrieves all available vessel types.
Returns:
Type | Description |
---|---|
Tuple[VesselType, ...]
|
A tuple of all available vessel types. |
Source code in signal_ocean/port_expenses/port_expenses_api.py
175 176 177 178 179 180 181 182 183 |
|
PortFilter
dataclass
¶
A filter used to find specific ports.
Attributes:
Name | Type | Description |
---|---|---|
name_like |
Optional[str]
|
Used to find ports by name. When specified, ports whose names partially match (contain) the attribute's value will be returned. Matching is case-insensitive. |
Source code in signal_ocean/port_expenses/port_filter.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
VesselType
dataclass
¶
A vessel type.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The vessel type id, e.g. 1 -> Tanker, 3 -> Dry, 4 -> Containers, 5 -> LNG (Liquified Natural gas), 6-> LPG (Liquified Petroleum Gas). |
name |
str
|
The vessel type name, e.g. Tanker, Dry, Containers, LNG (Liquified Natural gas), LPG (Liquified Petroleum Gas). |
Source code in signal_ocean/port_expenses/models.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|