pipeline.src.flows.ports ======================== .. py:module:: pipeline.src.flows.ports Functions --------- .. autoapisummary:: pipeline.src.flows.ports.make_date pipeline.src.flows.ports.make_lat_lon pipeline.src.flows.ports.extract_unece_locations pipeline.src.flows.ports.clean_unece pipeline.src.flows.ports.load_unece pipeline.src.flows.ports.flow_make_unece_ports pipeline.src.flows.ports.extract_circabc_locations pipeline.src.flows.ports.clean_circabc pipeline.src.flows.ports.load_circabc pipeline.src.flows.ports.flow_make_circabc_ports pipeline.src.flows.ports.extract_unece_ports pipeline.src.flows.ports.extract_circabc_ports pipeline.src.flows.ports.merge_circabc_unece pipeline.src.flows.ports.combine_columns_into_value pipeline.src.flows.ports.clean_ports pipeline.src.flows.ports.parse_ports_names pipeline.src.flows.ports.load_port_codes pipeline.src.flows.ports.flow_combine_circabc_unece_ports pipeline.src.flows.ports.geocode_row pipeline.src.flows.ports.geocode_row_google pipeline.src.flows.ports.extract_port_codes pipeline.src.flows.ports.extract_active_ports_locodes pipeline.src.flows.ports.flag_active_ports pipeline.src.flows.ports.geocode_ports pipeline.src.flows.ports.load_geocoded_ports pipeline.src.flows.ports.flow_geocode_ports pipeline.src.flows.ports.extract_local_ports pipeline.src.flows.ports.compute_ports_zones pipeline.src.flows.ports.clean_fao_areas pipeline.src.flows.ports.transform_ports_open_data pipeline.src.flows.ports.invalidate_cache pipeline.src.flows.ports.load_ports pipeline.src.flows.ports.ports_flow Module Contents --------------- .. py:function:: make_date(date_string: str) .. py:function:: make_lat_lon(lat_lon: str) .. py:function:: extract_unece_locations(csv_directory_path) .. py:function:: clean_unece(locations) .. py:function:: load_unece(locations) .. py:function:: flow_make_unece_ports(csv_directory_path: str) .. py:function:: extract_circabc_locations(csv_filepath) .. py:function:: clean_circabc(locations) .. py:function:: load_circabc(locations) .. py:function:: flow_make_circabc_ports(csv_filepath: str) .. py:function:: extract_unece_ports() .. py:function:: extract_circabc_ports() .. py:function:: merge_circabc_unece(circabc_ports, unece_ports) .. py:function:: combine_columns_into_value(ports) .. py:function:: clean_ports(ports: pandas.DataFrame) -> pandas.DataFrame Rename ambiguous port names and change incorrect country codes .. py:function:: parse_ports_names(ports) .. py:function:: load_port_codes(ports) .. py:function:: flow_combine_circabc_unece_ports() .. py:function:: geocode_row(row) .. py:function:: geocode_row_google(row) .. py:function:: extract_port_codes() .. py:function:: extract_active_ports_locodes() -> set .. py:function:: flag_active_ports(ports: pandas.DataFrame, active_ports_locodes: set) -> pandas.DataFrame .. py:function:: geocode_ports(ports) .. py:function:: load_geocoded_ports(geocoded_ports) .. py:function:: flow_geocode_ports() .. py:function:: extract_local_ports() -> pandas.DataFrame .. py:function:: compute_ports_zones(ports: pandas.DataFrame) -> pandas.DataFrame Compute ports FAO areas, façades and departments. .. py:function:: clean_fao_areas(ports: pandas.DataFrame) -> pandas.DataFrame Keep only the smallest FAO area(s) of each port. .. py:function:: transform_ports_open_data(ports: pandas.DataFrame) -> pandas.DataFrame .. py:function:: invalidate_cache() .. py:function:: load_ports(ports) .. py:function:: ports_flow(dataset_id: str = PORTS_DATASET_ID, ports_resource_id: str = PORTS_CSV_RESOURCE_ID, ports_resource_title: str = PORTS_CSV_RESOURCE_TITLE, is_integration: bool = IS_INTEGRATION, extract_local_ports_fn: Callable = extract_local_ports, update_resource_fn: Callable = update_resource, invalidate_cache_fn: Callable = invalidate_cache)