tracktable.info.ports module
Module contents
- tracktable.info.ports.all_ports()[source]
Return all the port records we have.
- Returns:
Unsorted list of port objects.
- tracktable.info.ports.all_ports_by_country(country)[source]
Return all the port records we have for a given country.
- Parameters:
country (str) – Country to return all ports from.
- Returns:
Dictionary of ports from the given country.
- tracktable.info.ports.all_ports_by_water_body(water_body)[source]
Return all the port records we have from a given water body.
- Parameters:
water_body (str) – Water body to return all ports from.
- Returns:
Dictionary of ports from the given water body.
- tracktable.info.ports.all_ports_by_wpi_region(wpi_region)[source]
Return all the port records we have from a given wpi region.
- tracktable.info.ports.all_ports_within_bounding_box(bounding_box)[source]
Return all the port records we have from a given bounding box.
- Parameters:
bounding_box (Bounding Box) – Bounding box to return all ports from.
- Returns:
Dictionary of ports from the given bounding box.
- tracktable.info.ports.build_port_dict()[source]
Assemble the port dictionary on first access
This function is called whenever the user tries to look up an port. It checks to make sure the table has been populated and, if not, loads it from disk.
- Returns:
None
- Side Effects:
Port data will be loaded if not already in memory
- tracktable.info.ports.port_information(port_info, country=None)[source]
Look up information about an port
- Parameters:
port_info (str or int) – Name (str), Alternate Name (str) or World Port Index Number (int) of port
- Keyword Arguments:
country (string) – Country containing the desired port. (Default: None)
- Returns:
Port object containing requested information or list of ports if there are multiple matching port names.
- Raises:
KeyError – no such port