vortexasdk.endpoints.geographies

Try me out in your browser:

Binder

Geographies

Geographies(self)

Geographies endpoint.

load_all

Geographies.load_all()

Load all geographies.

search

Geographies.search(
  term: typing.Union[str, typing.List[str], NoneType] = None,
  exact_term_match: bool = False,
  filter_layer: typing.Optional[str] = None)

Find all geographies matching given search terms.

Arguments

  • term: The geography name (or names) we're filtering on

    exact_term_match: Search on only exact term matches, or allow similar matches. e.g. When searching for "China" with exact_term_match=False, then the SDK will yield geographies named ['China', 'South China', 'China Energy Services Ningbo'...] etc. When exact_term_match=True, the SDK will only yield the geography named China.

    filter_layer: Must be one of: terminal, port, country, country_zone, shipping_region, shipping_region_v2, wider_shipping_region, region, alternative_region, trading_block, trading_region, trading_subregion, state_or_province, sts_zone, waypoint, storage, storage_terminal, basin, root, or not provided.

Returns

List of geographies matching term

Examples

Find all geographies with portsmouth in the name.

>>> from vortexasdk import Geographies
>>> [x.name for x in Geographies().search(term="portsmouth").to_list()]
['Portsmouth [GB]', 'Portsmouth, NH [US]']

Search multiple geography terms

>>> df = Geographies().search(term=["Liverpool", "Southampton"]).to_df()

returns

id name layer
0 b63d8f625669fd... Liverpool [GB] ['port']
1 0cb7d4566de0f2... Southampton [GB] ['port']
2 8b4273e3181f2d... Liverpool Docks ['terminal']
3 98c50b0d2ee2b1... Liverpool Bulk Liquids ['terminal']

reference

Geographies.reference(id: str)

Perform a geography lookup.

Arguments

  • id: Geography ID to lookup

Returns

Geography matching the ID

Further Documentation:

VortexaAPI Geography Reference

vortexasdk.endpoints.geographies_result

GeographyResult

GeographyResult(*, records: typing.List,
                reference: typing.Dict[str, typing.Any])

Container class that holds the result obtained from calling the Geography endpoint.

model_config

to_list

GeographyResult.to_list()

Represent geographies as a list.

to_df

GeographyResult.to_df(
    columns:
    typing.Union[typing_extensions.Literal['all'], typing.List[str], NoneType] = ['id', 'name', 'layer']
)

Represent geographies as a pd.DataFrame.

Arguments

  • columns: The geography features we want in the dataframe. Enter columns='all' to include all features. Defaults to columns = ['id', 'name', 'layer'].

Returns

pd.DataFrame of geographies.