client ====== .. py:module:: client Attributes ---------- .. autoapisummary:: client.S3_BASE_LANES_FILE Exceptions ---------- .. autoapisummary:: client.LeafGraphException Classes ------- .. autoapisummary:: client.LeafGraphClient Module Contents --------------- .. py:exception:: LeafGraphException Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. .. py:class:: LeafGraphClient(host: Optional[str] = None, port: Optional[int] = 7687, username: Optional[str] = None, password: Optional[str] = None, **kwargs) Bases: :py:obj:`gqlalchemy.Memgraph` .. py:method:: build_graph(drop_existing: bool = False) -> None Pulls all network lanes from Postgres and updates the graph DB. Check the pgSQL `analytics.get_company_network_lanes` for details on which lanes are included. :param drop_existing: Drop existing graph nodes. Defaults to False. :type drop_existing: bool, optional .. py:method:: check_lanes(lane_ids: List[str]) -> int Given a list of lane IDs, returns the number of lane IDs that exist in the graph. :param lane_ids: List of lane IDs to check. :type lane_ids: List[str] :returns: Number of (lane) IDs that exist in the graph. :rtype: int .. py:method:: count_nodes(labels: Union[str, List[str], None] = None, **kwargs) -> int .. py:method:: count_relationships(relationship_type: str | None = None) -> int .. py:method:: create_indexes() -> None .. py:method:: delete_disconnected_locations() -> None Delete origins and destinations that are not connected to any lanes. .. py:method:: delete_lanes_by_company_id(company_id: int, record_type: str, equipment_class: str = 'DRY') -> None .. py:method:: delete_lanes_by_id(lane_ids: list[str]) -> None .. py:method:: get_all_owners() -> List[int] Returns a list of all owner IDs in the graph. :returns: List of owner IDs. :rtype: List[int] .. py:method:: update_from_df(lanes_df: pandas.DataFrame) -> None .. py:method:: update_from_file(file_url: str) -> None .. py:method:: update_long_deadhead_relationships() -> None .. py:method:: update_short_deadhead_relationships() -> None .. py:data:: S3_BASE_LANES_FILE :value: 'adapt_assets/graph_lanes.json'