Skip to main content

index

Module to manage the database index and its ID's.

get_index_dict

get_index_dict () -> dict

Returns a dictionary of all known databases.

Parameters:
    Returns:
      <class 'dict'>

    get_known_paths

    get_known_paths () -> list

    None

    Parameters:
      Returns:
        <class 'list'>

      uid2

      uid2 (uid) -> str

      None

      Parameters:
      • uid : Any

      Returns:
        <class 'str'>

      get_uid_from_path

      get_uid_from_path (path: str) -> str

      Returns the UID found in the specified path.

      Parameters:
      • path : <class 'str'>

      Returns:
        <class 'str'>

      record_database

      record_database (uid: str, path: str) -> None

      Record a database in `database_index.json`

      Parameters:
      • uid : <class 'str'>

        the uid of the database

      • path : <class 'str'>

        the path of the database

      Returns:
        None

      get_path

      get_path (uid: str) -> str

      Find the path of a database specified by its UID.

      Parameters:
      • uid : <class 'str'>

        the UID of the database

      Returns:
        <class 'str'>

      find

      find (uid, root_dir) -> list

      Find the database with UID under given root_dir.

      Parameters:
      • uid : Any

        UID to search for

      • root_dir : Any

        root directory for search

      Returns:
        <class 'list'>

      clean

      clean () -> None

      Clean the database index from wrong paths.

      Parameters:
        Returns:
          None

        create_index

        create_index () -> None

        Create database index from known paths.

        Parameters:
          Returns:
            None