Skip to content

Package Documentation

Voyages API Package.

Classes:

Name Description
VoyagesMarketDataAPI

Represents Signal's VoyagesMarketData API.

MatchedFixture

Represents the matched fixture of a voyage.

Fixture

Represents a single fixture.

VoyagesMarketData

Holds all information on a single voyage

Fixture dataclass

Fixture information.

Attributes:

Name Type Description
next_page_token

String. The key that should be used as a parameter of the token to retrieve the next page.

is_matched Optional[bool]

Boolean. This will be true if the market data item is matched to the corresponding voyage.

is_load_matched Optional[bool]

Boolean. This will be true if the load of the market data item is matched to the corresponding voyage.

is_discharge_matched Optional[bool]

Boolean. This will be true if the load of the market data item is matched to the corresponding voyage.

fixture_status_id Optional[int]

0-> OnSubs, 1-> FullyFixed, 2-> Failed, 3-> Cancelled, 4-> Available, -2-> NotSet, -1-> Unknown

fixture_status Optional[str]

String, based on the status of the market data item. Potential values are OnSubs, FullyFixed, Failed, Cancelled, Available

Source code in signal_ocean/voyages_market_data/models.py
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
@dataclass(frozen=True)
class Fixture:
    """Fixture information.

    Attributes:
        next_page_token: String. The key that should be used as a parameter
            of the token to retrieve the next page.
        is_matched: Boolean. This will be true if the market data item is
            matched to the corresponding voyage.
        is_load_matched: Boolean. This will be true if the load of the market
            data item is matched to the corresponding voyage.
        is_discharge_matched: Boolean. This will be true if the load of the
            market data item is matched to the corresponding voyage.
        fixture_status_id: 0-> OnSubs, 1-> FullyFixed, 2-> Failed,
            3-> Cancelled, 4-> Available, -2-> NotSet, -1-> Unknown
        fixture_status: String, based on the status of the market data item.
            Potential values are OnSubs, FullyFixed, Failed, Cancelled,
            Available
    """

    fixture_id: Optional[int] = None
    is_matched: Optional[bool] = None
    is_load_matched: Optional[bool] = None
    is_discharge_matched: Optional[bool] = None
    fixture_status_id: Optional[int] = None
    fixture_status: Optional[str] = None

MatchedFixture dataclass

Contains information about a single fixture.

Attributes:

Name Type Description
fixture_status_id Optional[int]

Numeric ID corresponding to the different values of the FixtureStatus field. 0-> OnSubs, 1-> FullyFixed, 2-> Failed, 3-> Cancelled , 4-> Available, 5-> PossFixed, -2-> NotSet, -1-> Unknown.

fixture_status Optional[str]

String denoting the commercial status of a fixture if explicitly mentioned, like ffxd for fully fixed or subs for on subs.

charter_type_id Optional[int]

Numeric ID corresponding to the different values of the ChartererType field. 0-> Voyage, 1-> Time charter

charter_type Optional[str]

String denoting the type of the charter

charterer_id Optional[int]

Numeric ID corresponding to the company reported as charterer in at least one of the fixtures.

charterer Optional[str]

String, name of the company reported as charterer in at least one of the fixtures.

laycan_from Optional[datetime]

Date, format YYYY-MM-DD indicates the earliest reported Laycan From (latest day of cancellation) across all fixtures.

laycan_to Optional[datetime]

Date, format YYYY-MM-DD indicates the latest reported Laycan To (latest day of cancellation) across all fixtures.

load_geo_id Optional[int]

Numeric ID corresponding to the id of the load geo asset

load_name Optional[str]

String, name of the load geo asset

load_taxonomy_id Optional[int]

1-> GeoAsset, 2-> Port, 3-> Country, 4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid, -2-> NotSet, -1-> Unknown

load_taxonomy Optional[str]

String, the taxonomy of the load geo asset

load_geo_id2 Optional[int]

Numeric ID corresponding to the id of the load geo asset

load_name Optional[str]

String, name of the load geo asset

load_name2 Optional[str]

String, the taxonomy of the second load geo asset

load_taxonomy_id2 Optional[int]

1-> GeoAsset, 2-> Port, 3-> Country, 4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid, -2-> NotSet, -1-> Unknown

load_taxonomy2 Optional[str]

String, the taxonomy of the load geo asset

discharge_geo_id Optional[int]

Numeric ID corresponding to the id of the discharge geo asset

discharge_name Optional[str]

String, name of the discharge geo asset

discharge_taxonomy_id Optional[int]

1-> GeoAsset, 2-> Port, 3-> Country, 4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid, -2-> NotSet, -1-> Unknown

discharge_taxonomy Optional[str]

String, the taxonomy of the discharge geo asset

discharge_geo_id2 Optional[int]

Numeric ID corresponding to the id of the discharge geo

discharge_name2 Optional[str]

String, name of the discharge geo asset

discharge_taxonomy_id2 Optional[int]

1-> GeoAsset, 2-> Port, 3-> Country, 4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid, -2-> NotSet, -1-> Unknown

discharge_taxonomy2 Optional[str]

String, the taxonomy of the discharge geo asset

cargo_type_id Optional[int]

numeric ID corresponding to the type of cargo the vessel carries in this voyage. For example 19-> Crude Oil, 16->Fueloil, 9-> Naphtha, 135-> Unleaded Motor Spirit, 12-> Gasoil

cargo_type Optional[str]

String, it corresponds to the estimated cargo type the vessel carries according to the specific voyage, AIS information, jetty the vessel may have visited or information coming from market reports.

cargo_group_id Optional[int]

Numeric ID corresponding to the high-level cargo the vessel carries in this voyage, therefore called cargo group. For example 130000->Dirty, 120000-> Clean

cargo_group Optional[str]

String, it corresponds to the estimated high-level cargo the vessel carries in this voyage, according to AIS information and jetties the vessel may have visited or information coming from market reports.

quantity Optional[int]

Numeric, measured in kilotonnes [kt]. It is the cargo quantity reported in at least one of the market reports.

quantity_buffer Optional[int]

Buffer on the agreed quantity.

rate Optional[int]

Numeric, indicates the rate reported in at least one of the fixtures. If lump sum, the rate is reported in USD.

rate_type Optional[str]

String, indicates the type of rate reported in at least one of the fixtures. Main types are "WS" for World Scale, "LS" for Lump Sum, "TCE" ($/day) for Time Charter Equivalent.

ballast_bonus_value Optional[int]

Numeric, indicates the incentive or compensation paid to the ship owner for delivering the ship to the agreed delivery place. Derived from market info whenever available.

ballast_bonus_type Optional[str]

String, indicates the currency of the ballast bonus, "$"(dollars).

delivery_geo_id Optional[int]

Numeric ID corresponding to the id of the delivery geo asset

delivery_name Optional[str]

String, name of the delivery geo asset

delivery_taxonomy_id Optional[int]

1-> GeoAsset, 2-> Port, 3-> Country, 4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid, -2-> NotSet, -1-> Unknown

delivery_taxonomy Optional[str]

String, the taxonomy of the delivery geo asset

delivery_date_from Optional[datetime]

The start date of the delivery

delivery_date_to Optional[datetime]

The end date of the delivery

redelivery_from_geo_id Optional[int]

Numeric ID corresponding to the id of the redelivery from geo

redelivery_from_name Optional[str]

String, name of the redelivery from geo asset

redelivery_from_taxonomy_id Optional[int]

1-> GeoAsset, 2-> Port, 3-> Country, 4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid, -2-> NotSet, -1-> Unknown

redelivery_from_taxonomy Optional[str]

String, the taxonomy of the redelivery from geo asset

redelivery_to_geo_id Optional[int]

Numeric ID corresponding to the id of the redelivery to geo asset

redelivery_to_name Optional[str]

String, name of the redelivery to geo asset

redelivery_to_taxonomy_id Optional[int]

1-> GeoAsset, 2-> Port, 3-> Country, 4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid, -2-> NotSet, -1-> Unknown

redelivery_to_taxonomy Optional[str]

String, the taxonomy of the redelivery to geo asset

user_entries Optional[int]

The number of the user entries for the voyage

full_fixtures Optional[int]

The number of full fixtures for the voyage

partial_fixtures Optional[int]

The number of partial fixtures for the voyage

is_coa Optional[bool]

Boolean. Value is true if "COA" (Contract of Affreightment) is explicitly reported in at least one of the fixtures relative to the specific voyage

is_owners_option Optional[bool]

Boolean, indicating if owners option is agreed

is_hold Optional[bool]

Boolean. Value is true if "Hold" is explicitly reported in at least one of the fixtures relative to the specific voyage

is_fio Optional[bool]

Boolean, is free in and out. If true, charterer pays for loading and unloading

sources Optional[Tuple[str, ...]]

A list of the sources

Source code in signal_ocean/voyages_market_data/models.py
  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
 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
@dataclass(frozen=True)
class MatchedFixture:
    """Contains information about a single fixture.

    Attributes:
        fixture_status_id: Numeric ID corresponding to the different values of
            the FixtureStatus field. 0-> OnSubs, 1-> FullyFixed,
            2-> Failed, 3-> Cancelled , 4-> Available, 5-> PossFixed,
            -2-> NotSet, -1-> Unknown.
        fixture_status: String denoting the commercial status of a fixture if
            explicitly mentioned, like ffxd for fully fixed or subs for on
            subs.
        charter_type_id: Numeric ID corresponding to the different values of
            the ChartererType field. 0-> Voyage, 1-> Time charter
        charter_type: String denoting the type of the charter
        charterer_id: Numeric ID corresponding to the company reported as
            charterer in at least one of the fixtures.
        charterer: String, name of the company reported as charterer in at
            least one of the fixtures.
        laycan_from: Date, format YYYY-MM-DD indicates the earliest reported
            Laycan From (latest day of cancellation) across all fixtures.
        laycan_to: Date, format YYYY-MM-DD indicates the latest reported
            Laycan To (latest day of cancellation) across all fixtures.
        load_geo_id: Numeric ID corresponding to the id of the load geo asset
        load_name: String, name of the load geo asset
        load_taxonomy_id: 1-> GeoAsset, 2->  Port, 3-> Country, 4-> Level0,
            5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid, -2-> NotSet,
            -1-> Unknown
        load_taxonomy: String, the taxonomy of the load geo asset
        load_geo_id2:  Numeric ID corresponding to the id of the load geo
            asset
        load_name: String, name of the load geo asset
        load_name2: String, the taxonomy of the second load geo asset
        load_taxonomy_id2: 1-> GeoAsset, 2->  Port, 3-> Country, 4-> Level0,
            5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid, -2-> NotSet,
            -1-> Unknown
        load_taxonomy2: String, the taxonomy of the load geo asset
        discharge_geo_id: Numeric ID corresponding to the id of the discharge
            geo asset
        discharge_name: String, name of the discharge geo asset
        discharge_taxonomy_id: 1-> GeoAsset, 2->  Port, 3-> Country,
            4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid,
            -2-> NotSet, -1-> Unknown
        discharge_taxonomy: String, the taxonomy of the discharge geo asset
        discharge_geo_id2: Numeric ID corresponding to the id of the discharge
            geo
        discharge_name2: String, name of the discharge geo asset
        discharge_taxonomy_id2: 1-> GeoAsset, 2->  Port, 3-> Country,
            4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid,
            -2-> NotSet, -1-> Unknown
        discharge_taxonomy2: String, the taxonomy of the discharge geo asset
        cargo_type_id: numeric ID corresponding to the type of cargo the
            vessel carries in this voyage. For example 19-> Crude Oil,
            16->Fueloil, 9-> Naphtha, 135-> Unleaded Motor Spirit, 12-> Gasoil
        cargo_type: String, it corresponds to the estimated cargo type the
            vessel carries according to the specific voyage, AIS information,
            jetty the vessel may have visited or information coming from
            market reports.
        cargo_group_id: Numeric ID corresponding to the high-level cargo the
            vessel carries in this voyage, therefore called cargo group.
            For example 130000->Dirty, 120000-> Clean
        cargo_group: String, it corresponds to the estimated high-level cargo
            the vessel carries in this voyage, according to AIS information
            and jetties the vessel may have visited or information coming from
            market reports.
        quantity: Numeric, measured in kilotonnes [kt]. It is the cargo
            quantity reported in at least one of the market reports.
        quantity_buffer: Buffer on the agreed quantity.
        rate: Numeric, indicates the rate reported in at least one of the
            fixtures. If lump sum, the rate is reported in USD.
        rate_type: String, indicates the type of rate reported in at least
            one of the fixtures. Main types are "WS" for World Scale, "LS"
            for Lump Sum, "TCE" ($/day) for Time Charter Equivalent.
        ballast_bonus_value: Numeric, indicates the incentive or compensation
            paid to the ship owner for delivering the ship to the agreed
            delivery place. Derived from market info whenever available.
        ballast_bonus_type: String, indicates the currency of the ballast
            bonus, "$"(dollars).
        delivery_geo_id: Numeric ID corresponding to the id of the delivery
            geo asset
        delivery_name: String, name of the delivery geo asset
        delivery_taxonomy_id: 1-> GeoAsset, 2->  Port, 3-> Country,
            4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid,
            -2-> NotSet, -1-> Unknown
        delivery_taxonomy: String, the taxonomy of the delivery geo asset
        delivery_date_from: The start date of the delivery
        delivery_date_to: The end date of the delivery
        redelivery_from_geo_id: Numeric ID corresponding to the id of the
            redelivery from geo
        redelivery_from_name: String, name of the  redelivery from geo asset
        redelivery_from_taxonomy_id: 1-> GeoAsset, 2->  Port, 3-> Country,
            4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid,
            -2-> NotSet, -1-> Unknown
        redelivery_from_taxonomy: String, the taxonomy of the redelivery from
            geo asset
        redelivery_to_geo_id: Numeric ID corresponding to the id of the
            redelivery to geo asset
        redelivery_to_name: String, name of the  redelivery to geo asset
        redelivery_to_taxonomy_id: 1-> GeoAsset, 2->  Port, 3-> Country,
            4-> Level0, 5-> Level1, 6-> Level2, 7-> Level3, -3-> Invalid,
            -2-> NotSet, -1-> Unknown
        redelivery_to_taxonomy: String, the taxonomy of the redelivery to geo
            asset
        user_entries: The number of the user entries for the voyage
        full_fixtures: The number of full fixtures for the voyage
        partial_fixtures: The number of partial fixtures for the voyage
        is_coa: Boolean. Value is true if "COA" (Contract of Affreightment)
            is explicitly reported in at least one of the fixtures relative
            to the specific voyage
        is_owners_option: Boolean, indicating if owners option is agreed
        is_hold: Boolean. Value is true if "Hold" is explicitly reported in
            at least one of the fixtures relative to the specific voyage
        is_fio: Boolean, is free in and out. If true, charterer pays for
            loading and unloading
        sources: A list of the sources

    """

    fixture_status_id: Optional[int] = None
    fixture_status: Optional[str] = None
    charter_type_id: Optional[int] = None
    charter_type: Optional[str] = None
    fixture_date: Optional[datetime] = None
    charterer_id: Optional[int] = None
    charterer: Optional[str] = None
    laycan_from: Optional[datetime] = None
    laycan_to: Optional[datetime] = None
    load_geo_id: Optional[int] = None
    load_name: Optional[str] = None
    load_taxonomy_id: Optional[int] = None
    load_taxonomy: Optional[str] = None
    load_geo_id2: Optional[int] = None
    load_name2: Optional[str] = None
    load_taxonomy_id2: Optional[int] = None
    load_taxonomy2: Optional[str] = None
    discharge_geo_id: Optional[int] = None
    discharge_name: Optional[str] = None
    discharge_taxonomy_id: Optional[int] = None
    discharge_taxonomy: Optional[str] = None
    discharge_geo_id2: Optional[int] = None
    discharge_name2: Optional[str] = None
    discharge_taxonomy_id2: Optional[int] = None
    discharge_taxonomy2: Optional[str] = None
    cargo_type_id: Optional[int] = None
    cargo_type: Optional[str] = None
    cargo_group_id: Optional[int] = None
    cargo_group: Optional[str] = None
    quantity: Optional[int] = None
    quantity_buffer: Optional[int] = None
    rate: Optional[int] = None
    rate_type: Optional[str] = None
    ballast_bonus_value: Optional[int] = None
    ballast_bonus_type: Optional[str] = None
    delivery_geo_id: Optional[int] = None
    delivery_name: Optional[str] = None
    delivery_taxonomy_id: Optional[int] = None
    delivery_taxonomy: Optional[str] = None
    delivery_date_from: Optional[datetime] = None
    delivery_date_to: Optional[datetime] = None
    redelivery_from_geo_id: Optional[int] = None
    redelivery_from_name: Optional[str] = None
    redelivery_from_taxonomy_id: Optional[int] = None
    redelivery_from_taxonomy: Optional[str] = None
    redelivery_to_geo_id: Optional[int] = None
    redelivery_to_name: Optional[str] = None
    redelivery_to_taxonomy_id: Optional[int] = None
    redelivery_to_taxonomy: Optional[str] = None
    user_entries: Optional[int] = None
    full_fixtures: Optional[int] = None
    partial_fixtures: Optional[int] = None
    is_coa: Optional[bool] = None
    is_owners_option: Optional[bool] = None
    is_hold: Optional[bool] = None
    is_fio: Optional[bool] = None
    sources: Optional[Tuple[str, ...]] = None

VoyagesMarketData dataclass

Contains information about a single fixture.

Attributes:

Name Type Description
id Optional[str]

String. Uniquely identifies the market data result.

voyage_id Optional[str]

String. Uniquely identifies the voyage.

imo Optional[int]

A seven-digits number that uniquely identifies a ship and does not change when the ship's owner, country of registry or name of the vessel changes.

voyage_number Optional[int]

Numeric, a counter of the voyages for the same IMO.

vessel_name Optional[str]

The vessel name corresponding to that IMO at the time of that voyage.

vessel_type_id Optional[int]

0-> Empty, 1-> Tanker, 3-> Dry, 4-> Container, 5-> Lng, 6-> Lpg, -2-> NotSet, -1-> Unknown

vessel_type Optional[str]

Description of the type of the vessel, based on the carried cargo. Main categories are Tankers, Dry (bulk carriers), Containers, LNG and LPG.

vessel_class_id Optional[int]

60-> VLGCLpg, 61-> MidsizeLpg, 62-> HandyLpg, 63-> SmallLpg, 69-> VLOC, 70-> Capesize, 72-> PostPanamaxDry, 74-> PanamaxDry, 75-> Supramax, 76-> Handymax, 77-> Handysize, 78-> ULCV, 79-> NewPanamaxContainer, 80-> PostPanamaxContainer, 81-> PanamaxContainer, 82-> FeedermaxContainer, 83-> FeederContainer, 84-> VLCC, 85-> Suezmax, 86-> Aframax, 87-> PanamaxTanker, 88-> MR2, 89-> MR1, 90-> Small, 91-> LNGLng, 92-> SmallDry, 94-> ULCC, 95-> SmallContainer

vessel_class Optional[str]

Name of the vessel class the vessel belongs to. Assignment of a vessel to a certain VesselClass is based on the VesselType and the value of its Deadweight (if Tanker or Dry), its LiquidCap (if LNG/LPG) or its TEU (if Containers). For example, an Aframax is a Tanker vessel with Deadweight within the range 82kt - 125kt, while a Capesize is a Dry vessel with Deadweight within the range 120kt-220kt. LR2 are defined as Aframax, as only Deadweight is used to define vessel classes.

trade_id Optional[int]

1-> Crude, 2-> Product, 3-> Chemical, -2-> NotSet, -1-> Unknown

trade Optional[str]

Additional attribute used to specify a Tanker vessel with finer granularity. It is derived by the last cargo carried by the vessel at the time of query. For example, an LR2 with fueloil as last cargo has VesselClass=Aframax and Trade=Product.

commercial_operator_id Optional[int]

Numeric ID corresponding to the maritime company that manages the vessel commercially.

commercial_operator Optional[str]

Name of the maritime company that manages the vessel commercially.

deadweight Optional[int]

Numeric, measured in tonnes [t], often shortened as DWT, denotes the total carrying capacity of the vessel including cargo, ballast water, stores, provisions, crew and so on.

year_built Optional[int]

Numeric, year format, the year the vessel was built.

matched_fixture Optional[MatchedFixture]

Nested object containing additional information on the matched fixture.

fixtures Optional[Tuple[Fixture, ...]]

Nested object containing information on fixtures for a given IMO and voyage.

Source code in signal_ocean/voyages_market_data/models.py
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
@dataclass(frozen=True)
class VoyagesMarketData:
    """Contains information about a single fixture.

    Attributes:
        id: String. Uniquely identifies the market data result.
        voyage_id: String. Uniquely identifies the voyage.
        imo: A seven-digits number that uniquely identifies a ship and does
            not change when the ship's owner, country of registry or name of
            the vessel changes.
        voyage_number: Numeric, a counter of the voyages for the same IMO.
        vessel_name: The vessel name corresponding to that IMO at the time
            of that voyage.
        vessel_type_id: 0-> Empty, 1-> Tanker, 3-> Dry, 4-> Container,
            5-> Lng, 6-> Lpg, -2-> NotSet, -1-> Unknown
        vessel_type: Description of the type of the vessel, based on the
            carried cargo. Main categories are Tankers, Dry (bulk carriers),
            Containers, LNG and LPG.
        vessel_class_id: 60-> VLGCLpg, 61-> MidsizeLpg, 62-> HandyLpg,
            63-> SmallLpg, 69-> VLOC, 70-> Capesize, 72-> PostPanamaxDry,
            74-> PanamaxDry, 75-> Supramax, 76-> Handymax, 77-> Handysize,
            78-> ULCV, 79-> NewPanamaxContainer, 80-> PostPanamaxContainer,
            81-> PanamaxContainer, 82-> FeedermaxContainer,
            83-> FeederContainer, 84-> VLCC, 85-> Suezmax, 86-> Aframax,
            87-> PanamaxTanker, 88-> MR2, 89-> MR1, 90-> Small, 91-> LNGLng,
            92-> SmallDry, 94-> ULCC, 95-> SmallContainer
        vessel_class: Name of the vessel class the vessel belongs to.
            Assignment of a vessel to a certain VesselClass is based on the
            VesselType and the value of its Deadweight (if Tanker or Dry),
            its LiquidCap (if LNG/LPG) or its TEU (if Containers). For
            example, an Aframax is a Tanker vessel with Deadweight within the
            range 82kt - 125kt, while a Capesize is a Dry vessel with
            Deadweight within the range 120kt-220kt. LR2 are defined as
            Aframax, as only Deadweight is used to define vessel classes.
        trade_id: 1-> Crude, 2-> Product, 3-> Chemical, -2-> NotSet,
            -1-> Unknown
        trade: Additional attribute used to specify a Tanker vessel with finer
            granularity. It is derived by the last cargo carried by the vessel
            at the time of query. For example, an LR2 with fueloil as last
            cargo has VesselClass=Aframax and Trade=Product.
        commercial_operator_id: Numeric ID corresponding to the maritime
            company that manages the vessel commercially.
        commercial_operator: Name of the maritime company that manages the
            vessel commercially.
        deadweight: Numeric, measured in tonnes [t], often shortened as DWT,
            denotes the total carrying capacity of the vessel including cargo,
            ballast water, stores, provisions, crew and so on.
        year_built: Numeric, year format, the year the vessel was built.
        matched_fixture: Nested object containing additional information on
            the matched fixture.
        fixtures: Nested object containing information on fixtures for a given
            IMO and voyage.


    """

    id: Optional[str] = None
    voyage_id: Optional[str] = None
    imo: Optional[int] = None
    voyage_number: Optional[int] = None
    vessel_name: Optional[str] = None
    vessel_type_id: Optional[int] = None
    vessel_type: Optional[str] = None
    vessel_class_id: Optional[int] = None
    vessel_class: Optional[str] = None
    trade_id: Optional[int] = None
    trade: Optional[str] = None
    commercial_operator_id: Optional[int] = None
    commercial_operator: Optional[str] = None
    deadweight: Optional[int] = None
    year_built: Optional[int] = None
    matched_fixture: Optional[MatchedFixture] = None
    fixtures: Optional[Tuple[Fixture, ...]] = None

VoyagesMarketDataAPI

Represents Signal's VoyagesMarketData API.

Source code in signal_ocean/voyages_market_data/voyages_market_data_api.py
 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
class VoyagesMarketDataAPI:
    """Represents Signal's VoyagesMarketData API."""

    relative_url = "voyages-market-data-api/v1/"
    advanced_url = "voyages-market-data-api/v1/marketData/search/advanced"

    def __init__(self, connection: Optional[Connection] = None):
        """Initializes VoyagesMarketDataAPI.

        Args:
            connection: API connection configuration. If not provided, the
                default connection method is used.
        """
        self.__connection = connection or Connection()

    @staticmethod
    def _get_endpoint(
        imo: Optional[int] = None,
        voyage_id: Optional[int] = None,
        voyage_number: Optional[int] = None,
        vessel_class_id: Optional[int] = None,
        vessel_type_id: Optional[int] = None,
        incremental: Optional[date] = None,
        include_vessel_details: Optional[bool] = None,
        include_fixtures: Optional[bool] = None,
        include_matched_fixture: Optional[bool] = None,
        include_labels: Optional[bool] = None,
        filter_by_matched_fixture: Optional[bool] = None
    ) -> str:
        """Retrieves the endpoint to call to construct the request.

        Args:
            imo: Return only voyages for the provided vessel IMO. If None
                voyages for all vessels are returned.
            voyage_id: If provided only market data with the requested voyage
                ID will be returned.
            voyage_number: If provided only market data with the requested
                voyageNumber will be returned.
            vessel_class_id: If provided only market data with the requested
                vesselClassId will be returned.
            vessel_type_id: If provided only market data with the requested
                vesselTypeId will be returned. Potential values are 0-> Empty,
                1-> Tanker, 3-> Dry, 4-> Container, 5-> Lng, 6-> Lpg,
                -2-> NotSet, -1-> Unknown
            incremental:  Return voyages incrementally, including voyages that
                may have been retrieved in previous calls and are now deleted.
            include_vessel_details: If set to true the following fields will
                be included in the response. VesselName, Deadweight,
                YearBuilt, VesselClass, VesselType, Trade, CommercialOperator
            include_fixtures: If True, information on fixtures will be
                included in the response.
            include_matched_fixture: If True, information on the matched
                fixture will be included in the response.
            include_labels: If set to true the following fields will be
                included in the response. Charterer, LoadName, LoadTaxonomy,
                LoadName2, LoadTaxonomy2, DischargeName, DischargeTaxonomy,
                DischargeName2, DischargeTaxonomy2, CargoType, CargoGroup,
                CargoGroupID, DeliveryName, DeliveryTaxonomy,
                RedeliveryFromName, RedeliveryFromTaxonomy, RedeliveryToName,
                RedeliveryToTaxonomy
            filter_by_matched_fixture: If set to true, only results with a
                matched fixture will be included in the response.

        Returns:
            The endpoint to call to retrieve the requested voyage market \
            data for the provided arguments.
        """
        endpoint_params = {}

        for key, value in locals().items():
            if key in {'include_vessel_details', 'include_fixtures',
                       'include_matched_fixture', 'include_labels',
                       'filter_by_matched_fixture'}:
                endpoint_params[key] = value

        endpoint = "marketData"

        if imo is not None:
            endpoint += f"/imo/{imo}"
            if voyage_number is not None:
                endpoint += f"/voyage/{voyage_number}"
        elif voyage_id is not None:
            endpoint += f"/type/{voyage_id}"
        elif vessel_class_id is not None:
            endpoint += f"/class/{vessel_class_id}"
        elif vessel_type_id is not None:
            endpoint += f"/type/{vessel_type_id}"
        else:
            raise NotImplementedError(
                "please provide at least one of the following arguments: "
                "imo, voyage_number, voyage_id, vessel_class_id, "
                "vessel_type_id")

        if imo is None and incremental is not None:
            endpoint += f"/incremental/{incremental}"

        endpoint += "?"

        params = urlencode(
            {
                _to_camel_case(key): value
                for key, value in endpoint_params.items()
                if value is not None
            }
        )
        endpoint += params

        return urljoin(VoyagesMarketDataAPI.relative_url, endpoint)

    def _get_voyage_market_data_pages(
        self, endpoint: str, token: Optional[str] = None
    ) -> Tuple[VoyagesMarketDataMultiple, Optional[NextRequestToken]]:
        """Retrieves data filtered for the provided parameters.

        Args:
            endpoint: The endpoint to call.
            token: Next request token for incremental voyage market data.
                Make consecutive requests until no next page token is
                returned, gather and return data.

        Returns:
            Voyage market data gathered from the returned pages.
            The next request token, to be used for incremental updates.
        """
        results: List[VoyagesMarketData] = []
        next_page_token = token
        while True:
            params = (
                {"token": next_page_token}
                if next_page_token is not None
                else None
            )
            response = get_single(
                self.__connection,
                endpoint,
                VoyagesMarketDataPagedResponse,
                query_string=params,
            )
            if response is not None and response.data is not None:
                results.extend(response.data)
            next_page_token = (
                response.next_page_token if response is not None else None
            )

            if next_page_token is None:
                break

        next_request_token = (
            response.next_request_token if response is not None else None
        )
        return tuple(results), next_request_token

    def get_voyage_market_data(
        self,
        imo: Optional[int] = None,
        voyage_id: Optional[int] = None,
        voyage_number: Optional[int] = None,
        vessel_class_id: Optional[int] = None,
        vessel_type_id: Optional[int] = None,
        incremental: Optional[date] = None,
        include_vessel_details: Optional[bool] = None,
        include_fixtures: Optional[bool] = None,
        include_matched_fixture: Optional[bool] = None,
        include_labels: Optional[bool] = None,
        filter_by_matched_fixture: Optional[bool] = None
    ) -> VoyagesMarketDataMultiple:
        """Retrieves market data filtered for the provided parameters.

        Args:
            imo: Return only voyages for the provided vessel IMO. If None
                voyages for all vessels are returned.
            voyage_id: If provided only market data with the requested voyage
                ID will be returned.
            voyage_number: If provided only market data with the requested
                voyageNumber will be returned.
            vessel_class_id: If provided only market data with the requested
                vesselClassId will be returned.
            vessel_type_id: If provided only market data with the requested
                vesselTypeId will be returned. Potential values are 0-> Empty,
                1-> Tanker, 3-> Dry, 4-> Container, 5-> Lng, 6-> Lpg,
                -2-> NotSet, -1-> Unknown
            incremental:  Return voyages incrementally, including voyages that
                may have been retrieved in previous calls and are now deleted.
            include_vessel_details: If set to true the following fields will
                be included in the response. VesselName, Deadweight,
                YearBuilt, VesselClass, VesselType, Trade, CommercialOperator
            include_fixtures: If True, information on fixtures will be
                included in the response.
            include_matched_fixture: If True, information on the matched
                fixture will be included in the response.
            include_labels: If set to true the following fields will be
                included in the response. Charterer, LoadName, LoadTaxonomy,
                LoadName2, LoadTaxonomy2, DischargeName, DischargeTaxonomy,
                DischargeName2, DischargeTaxonomy2, CargoType, CargoGroup,
                CargoGroupID, DeliveryName, DeliveryTaxonomy,
                RedeliveryFromName, RedeliveryFromTaxonomy, RedeliveryToName,
                RedeliveryToTaxonomy.
            filter_by_matched_fixture: If set to true, only results with a
                matched fixture will be included in the response.

        Returns:
            A tuple containing the returned voyage market data.
        """
        endpoint = self._get_endpoint(
                        imo, voyage_id, voyage_number, vessel_class_id,
                        vessel_type_id, incremental, include_vessel_details,
                        include_fixtures, include_matched_fixture,
                        include_labels, filter_by_matched_fixture
        )

        if imo is not None:
            results = get_multiple(self.__connection, endpoint,
                                   VoyagesMarketData, data_key_label='Data')
        else:
            results, _ = self._get_voyage_market_data_pages(endpoint)

        return results

    def get_voyage_market_data_advanced(
        self,
        imos: Optional[List[int]] = None,
        voyage_ids: Optional[List[str]] = None,
        vessel_class_ids: Optional[List[int]] = None,
        trade_id: Optional[int] = None,
        include_vessel_details: Optional[bool] = None,
        include_fixtures: Optional[bool] = None,
        include_lineups: Optional[bool] = None,
        include_positions: Optional[bool] = None,
        include_matched_fixture: Optional[bool] = None,
        filter_by_matched_fixture: Optional[bool] = None,
        fixture_date_from: Optional[date] = None,
        fixture_date_to: Optional[date] = None,
        laycan_date_from: Optional[date] = None,
        laycan_date_to: Optional[date] = None,
        include_labels: Optional[bool] = None,
        charterer_ids_include: Optional[List[int]] = None,
        charterer_ids_exclude: Optional[List[int]] = None,
        cargo_type_ids_include: Optional[List[int]] = None,
        cargo_type_ids_exclude: Optional[List[int]] = None,
        sources_include: Optional[List[str]] = None,
        sources_exclude: Optional[List[str]] = None
    ) -> VoyagesMarketDataMultiple:
        """Retrieves matched voyage market data for the provided parameters.

        Args:
            imos: Return only voyages for the provided vessel IMOs. If None
                voyages for all vessels are returned.
            voyage_ids: If provided only market data with the requested voyage
                IDs will be returned.
            vessel_class_ids: If provided only market data with the requested
                vesselClassIds will be returned.
            trade_id: If provided only market data for the requested trade id
                will be returned.
            include_vessel_details: If True the following fields will be
                included in the response. VesselName, Deadweight, YearBuilt,
                VesselClass, VesselType, Trade, CommercialOperator
            include_fixtures: If True, information on fixtures will be
                included in the response.
            include_lineups: If True, information on fixtures will be included
                in the response.
            include_positions: If True, information on positions will be
                included in the response.
            include_matched_fixture: If True, information on the matched
                fixture will be included in the response.
            filter_by_matched_fixture: If set to true, only results with a
                matched fixture will be included in the response.
            fixture_date_from: Date format 'YYYY-MM-DD', if included market
                data with a fixture date after the given date will be
                returned.
            fixture_date_to: Date format 'YYYY-MM-DD', if included market data
                with a fixture date prior to the given date will be returned.
            laycan_date_from: Date format 'YYYY-MM-DD', if included market
                data with a laycan date after the given date will be returned.
            laycan_date_to: Date format 'YYYY-MM-DD', if included market data
                with a laycan date prior to the given date will be returned.
            include_labels: If set to true the following fields will be
                included in the response. Charterer, LoadName, LoadTaxonomy,
                LoadName2, LoadTaxonomy2, DischargeName, DischargeTaxonomy,
                DischargeName2, DischargeTaxonomy2, CargoType, CargoGroup,
                CargoGroupID, DeliveryName, DeliveryTaxonomy,
                RedeliveryFromName, RedeliveryFromTaxonomy, RedeliveryToName,
                RedeliveryToTaxonomy.
            charterer_ids_include: If provided, charterers with the given ids
                will be included.
            charterer_ids_exclude: If provided, charterers with the given ids
                will be excluded.
            cargo_type_ids_include: If provided, market data for the give
                cargo type ids will be included.
            cargo_type_ids_exclude: If provided, market data for the give
                cargo type ids will be excluded.
            sources_include: If provided, market data from the give sources
                will be included.
            sources_exclude: If provided, market data from the give sources
                will be excluded.

        Returns:
            A tuple containing the returned voyage market data.
        """
        data_body: Dict[str, Any] = {}

        rename_keys = {'imos': 'IMOs',
                       'voyage_ids': 'VoyageIDs',
                       'vessel_class_ids': 'VesselClassIDs',
                       'trade_id': 'TradeID',
                       'charterer_ids_include': 'ChartererIDsInclude',
                       'charterer_ids_exclude': 'ChartererIDsExclude',
                       'cargo_type_ids_include': 'CargoTypeIDsInclude',
                       'cargo_type_ids_exclude': 'CargoTypeIDsExclude'}

        for key, value in locals().items():
            if key != 'self':
                if value:
                    cc_key = _to_camel_case(key, rename_keys=rename_keys)
                    data_body[cc_key] = value

        del data_body['DataBody']
        del data_body['RenameKeys']

        endpoint = VoyagesMarketDataAPI.advanced_url

        results: List[VoyagesMarketData] = []
        next_page_token = None

        while True:
            if next_page_token is not None:
                endpoint = VoyagesMarketDataAPI.advanced_url + \
                           f"?token={next_page_token}"
            response = post_single(self.__connection,
                                   endpoint,
                                   VoyagesMarketDataPagedResponse,
                                   query_string=data_body)
            if response is not None and response.data is not None:
                results.extend(response.data)
            next_page_token = (
                response.next_page_token if response is not None else None
            )
            if next_page_token is None:
                break

        next_request_token = (
            response.next_request_token if response is not None else None
        )

        return tuple(results)

__init__(connection=None)

Initializes VoyagesMarketDataAPI.

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/voyages_market_data/voyages_market_data_api.py
26
27
28
29
30
31
32
33
def __init__(self, connection: Optional[Connection] = None):
    """Initializes VoyagesMarketDataAPI.

    Args:
        connection: API connection configuration. If not provided, the
            default connection method is used.
    """
    self.__connection = connection or Connection()

get_voyage_market_data(imo=None, voyage_id=None, voyage_number=None, vessel_class_id=None, vessel_type_id=None, incremental=None, include_vessel_details=None, include_fixtures=None, include_matched_fixture=None, include_labels=None, filter_by_matched_fixture=None)

Retrieves market data filtered for the provided parameters.

Parameters:

Name Type Description Default
imo Optional[int]

Return only voyages for the provided vessel IMO. If None voyages for all vessels are returned.

None
voyage_id Optional[int]

If provided only market data with the requested voyage ID will be returned.

None
voyage_number Optional[int]

If provided only market data with the requested voyageNumber will be returned.

None
vessel_class_id Optional[int]

If provided only market data with the requested vesselClassId will be returned.

None
vessel_type_id Optional[int]

If provided only market data with the requested vesselTypeId will be returned. Potential values are 0-> Empty, 1-> Tanker, 3-> Dry, 4-> Container, 5-> Lng, 6-> Lpg, -2-> NotSet, -1-> Unknown

None
incremental Optional[date]

Return voyages incrementally, including voyages that may have been retrieved in previous calls and are now deleted.

None
include_vessel_details Optional[bool]

If set to true the following fields will be included in the response. VesselName, Deadweight, YearBuilt, VesselClass, VesselType, Trade, CommercialOperator

None
include_fixtures Optional[bool]

If True, information on fixtures will be included in the response.

None
include_matched_fixture Optional[bool]

If True, information on the matched fixture will be included in the response.

None
include_labels Optional[bool]

If set to true the following fields will be included in the response. Charterer, LoadName, LoadTaxonomy, LoadName2, LoadTaxonomy2, DischargeName, DischargeTaxonomy, DischargeName2, DischargeTaxonomy2, CargoType, CargoGroup, CargoGroupID, DeliveryName, DeliveryTaxonomy, RedeliveryFromName, RedeliveryFromTaxonomy, RedeliveryToName, RedeliveryToTaxonomy.

None
filter_by_matched_fixture Optional[bool]

If set to true, only results with a matched fixture will be included in the response.

None

Returns:

Type Description
VoyagesMarketDataMultiple

A tuple containing the returned voyage market data.

Source code in signal_ocean/voyages_market_data/voyages_market_data_api.py
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
def get_voyage_market_data(
    self,
    imo: Optional[int] = None,
    voyage_id: Optional[int] = None,
    voyage_number: Optional[int] = None,
    vessel_class_id: Optional[int] = None,
    vessel_type_id: Optional[int] = None,
    incremental: Optional[date] = None,
    include_vessel_details: Optional[bool] = None,
    include_fixtures: Optional[bool] = None,
    include_matched_fixture: Optional[bool] = None,
    include_labels: Optional[bool] = None,
    filter_by_matched_fixture: Optional[bool] = None
) -> VoyagesMarketDataMultiple:
    """Retrieves market data filtered for the provided parameters.

    Args:
        imo: Return only voyages for the provided vessel IMO. If None
            voyages for all vessels are returned.
        voyage_id: If provided only market data with the requested voyage
            ID will be returned.
        voyage_number: If provided only market data with the requested
            voyageNumber will be returned.
        vessel_class_id: If provided only market data with the requested
            vesselClassId will be returned.
        vessel_type_id: If provided only market data with the requested
            vesselTypeId will be returned. Potential values are 0-> Empty,
            1-> Tanker, 3-> Dry, 4-> Container, 5-> Lng, 6-> Lpg,
            -2-> NotSet, -1-> Unknown
        incremental:  Return voyages incrementally, including voyages that
            may have been retrieved in previous calls and are now deleted.
        include_vessel_details: If set to true the following fields will
            be included in the response. VesselName, Deadweight,
            YearBuilt, VesselClass, VesselType, Trade, CommercialOperator
        include_fixtures: If True, information on fixtures will be
            included in the response.
        include_matched_fixture: If True, information on the matched
            fixture will be included in the response.
        include_labels: If set to true the following fields will be
            included in the response. Charterer, LoadName, LoadTaxonomy,
            LoadName2, LoadTaxonomy2, DischargeName, DischargeTaxonomy,
            DischargeName2, DischargeTaxonomy2, CargoType, CargoGroup,
            CargoGroupID, DeliveryName, DeliveryTaxonomy,
            RedeliveryFromName, RedeliveryFromTaxonomy, RedeliveryToName,
            RedeliveryToTaxonomy.
        filter_by_matched_fixture: If set to true, only results with a
            matched fixture will be included in the response.

    Returns:
        A tuple containing the returned voyage market data.
    """
    endpoint = self._get_endpoint(
                    imo, voyage_id, voyage_number, vessel_class_id,
                    vessel_type_id, incremental, include_vessel_details,
                    include_fixtures, include_matched_fixture,
                    include_labels, filter_by_matched_fixture
    )

    if imo is not None:
        results = get_multiple(self.__connection, endpoint,
                               VoyagesMarketData, data_key_label='Data')
    else:
        results, _ = self._get_voyage_market_data_pages(endpoint)

    return results

get_voyage_market_data_advanced(imos=None, voyage_ids=None, vessel_class_ids=None, trade_id=None, include_vessel_details=None, include_fixtures=None, include_lineups=None, include_positions=None, include_matched_fixture=None, filter_by_matched_fixture=None, fixture_date_from=None, fixture_date_to=None, laycan_date_from=None, laycan_date_to=None, include_labels=None, charterer_ids_include=None, charterer_ids_exclude=None, cargo_type_ids_include=None, cargo_type_ids_exclude=None, sources_include=None, sources_exclude=None)

Retrieves matched voyage market data for the provided parameters.

Parameters:

Name Type Description Default
imos Optional[List[int]]

Return only voyages for the provided vessel IMOs. If None voyages for all vessels are returned.

None
voyage_ids Optional[List[str]]

If provided only market data with the requested voyage IDs will be returned.

None
vessel_class_ids Optional[List[int]]

If provided only market data with the requested vesselClassIds will be returned.

None
trade_id Optional[int]

If provided only market data for the requested trade id will be returned.

None
include_vessel_details Optional[bool]

If True the following fields will be included in the response. VesselName, Deadweight, YearBuilt, VesselClass, VesselType, Trade, CommercialOperator

None
include_fixtures Optional[bool]

If True, information on fixtures will be included in the response.

None
include_lineups Optional[bool]

If True, information on fixtures will be included in the response.

None
include_positions Optional[bool]

If True, information on positions will be included in the response.

None
include_matched_fixture Optional[bool]

If True, information on the matched fixture will be included in the response.

None
filter_by_matched_fixture Optional[bool]

If set to true, only results with a matched fixture will be included in the response.

None
fixture_date_from Optional[date]

Date format 'YYYY-MM-DD', if included market data with a fixture date after the given date will be returned.

None
fixture_date_to Optional[date]

Date format 'YYYY-MM-DD', if included market data with a fixture date prior to the given date will be returned.

None
laycan_date_from Optional[date]

Date format 'YYYY-MM-DD', if included market data with a laycan date after the given date will be returned.

None
laycan_date_to Optional[date]

Date format 'YYYY-MM-DD', if included market data with a laycan date prior to the given date will be returned.

None
include_labels Optional[bool]

If set to true the following fields will be included in the response. Charterer, LoadName, LoadTaxonomy, LoadName2, LoadTaxonomy2, DischargeName, DischargeTaxonomy, DischargeName2, DischargeTaxonomy2, CargoType, CargoGroup, CargoGroupID, DeliveryName, DeliveryTaxonomy, RedeliveryFromName, RedeliveryFromTaxonomy, RedeliveryToName, RedeliveryToTaxonomy.

None
charterer_ids_include Optional[List[int]]

If provided, charterers with the given ids will be included.

None
charterer_ids_exclude Optional[List[int]]

If provided, charterers with the given ids will be excluded.

None
cargo_type_ids_include Optional[List[int]]

If provided, market data for the give cargo type ids will be included.

None
cargo_type_ids_exclude Optional[List[int]]

If provided, market data for the give cargo type ids will be excluded.

None
sources_include Optional[List[str]]

If provided, market data from the give sources will be included.

None
sources_exclude Optional[List[str]]

If provided, market data from the give sources will be excluded.

None

Returns:

Type Description
VoyagesMarketDataMultiple

A tuple containing the returned voyage market data.

Source code in signal_ocean/voyages_market_data/voyages_market_data_api.py
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
def get_voyage_market_data_advanced(
    self,
    imos: Optional[List[int]] = None,
    voyage_ids: Optional[List[str]] = None,
    vessel_class_ids: Optional[List[int]] = None,
    trade_id: Optional[int] = None,
    include_vessel_details: Optional[bool] = None,
    include_fixtures: Optional[bool] = None,
    include_lineups: Optional[bool] = None,
    include_positions: Optional[bool] = None,
    include_matched_fixture: Optional[bool] = None,
    filter_by_matched_fixture: Optional[bool] = None,
    fixture_date_from: Optional[date] = None,
    fixture_date_to: Optional[date] = None,
    laycan_date_from: Optional[date] = None,
    laycan_date_to: Optional[date] = None,
    include_labels: Optional[bool] = None,
    charterer_ids_include: Optional[List[int]] = None,
    charterer_ids_exclude: Optional[List[int]] = None,
    cargo_type_ids_include: Optional[List[int]] = None,
    cargo_type_ids_exclude: Optional[List[int]] = None,
    sources_include: Optional[List[str]] = None,
    sources_exclude: Optional[List[str]] = None
) -> VoyagesMarketDataMultiple:
    """Retrieves matched voyage market data for the provided parameters.

    Args:
        imos: Return only voyages for the provided vessel IMOs. If None
            voyages for all vessels are returned.
        voyage_ids: If provided only market data with the requested voyage
            IDs will be returned.
        vessel_class_ids: If provided only market data with the requested
            vesselClassIds will be returned.
        trade_id: If provided only market data for the requested trade id
            will be returned.
        include_vessel_details: If True the following fields will be
            included in the response. VesselName, Deadweight, YearBuilt,
            VesselClass, VesselType, Trade, CommercialOperator
        include_fixtures: If True, information on fixtures will be
            included in the response.
        include_lineups: If True, information on fixtures will be included
            in the response.
        include_positions: If True, information on positions will be
            included in the response.
        include_matched_fixture: If True, information on the matched
            fixture will be included in the response.
        filter_by_matched_fixture: If set to true, only results with a
            matched fixture will be included in the response.
        fixture_date_from: Date format 'YYYY-MM-DD', if included market
            data with a fixture date after the given date will be
            returned.
        fixture_date_to: Date format 'YYYY-MM-DD', if included market data
            with a fixture date prior to the given date will be returned.
        laycan_date_from: Date format 'YYYY-MM-DD', if included market
            data with a laycan date after the given date will be returned.
        laycan_date_to: Date format 'YYYY-MM-DD', if included market data
            with a laycan date prior to the given date will be returned.
        include_labels: If set to true the following fields will be
            included in the response. Charterer, LoadName, LoadTaxonomy,
            LoadName2, LoadTaxonomy2, DischargeName, DischargeTaxonomy,
            DischargeName2, DischargeTaxonomy2, CargoType, CargoGroup,
            CargoGroupID, DeliveryName, DeliveryTaxonomy,
            RedeliveryFromName, RedeliveryFromTaxonomy, RedeliveryToName,
            RedeliveryToTaxonomy.
        charterer_ids_include: If provided, charterers with the given ids
            will be included.
        charterer_ids_exclude: If provided, charterers with the given ids
            will be excluded.
        cargo_type_ids_include: If provided, market data for the give
            cargo type ids will be included.
        cargo_type_ids_exclude: If provided, market data for the give
            cargo type ids will be excluded.
        sources_include: If provided, market data from the give sources
            will be included.
        sources_exclude: If provided, market data from the give sources
            will be excluded.

    Returns:
        A tuple containing the returned voyage market data.
    """
    data_body: Dict[str, Any] = {}

    rename_keys = {'imos': 'IMOs',
                   'voyage_ids': 'VoyageIDs',
                   'vessel_class_ids': 'VesselClassIDs',
                   'trade_id': 'TradeID',
                   'charterer_ids_include': 'ChartererIDsInclude',
                   'charterer_ids_exclude': 'ChartererIDsExclude',
                   'cargo_type_ids_include': 'CargoTypeIDsInclude',
                   'cargo_type_ids_exclude': 'CargoTypeIDsExclude'}

    for key, value in locals().items():
        if key != 'self':
            if value:
                cc_key = _to_camel_case(key, rename_keys=rename_keys)
                data_body[cc_key] = value

    del data_body['DataBody']
    del data_body['RenameKeys']

    endpoint = VoyagesMarketDataAPI.advanced_url

    results: List[VoyagesMarketData] = []
    next_page_token = None

    while True:
        if next_page_token is not None:
            endpoint = VoyagesMarketDataAPI.advanced_url + \
                       f"?token={next_page_token}"
        response = post_single(self.__connection,
                               endpoint,
                               VoyagesMarketDataPagedResponse,
                               query_string=data_body)
        if response is not None and response.data is not None:
            results.extend(response.data)
        next_page_token = (
            response.next_page_token if response is not None else None
        )
        if next_page_token is None:
            break

    next_request_token = (
        response.next_request_token if response is not None else None
    )

    return tuple(results)