Skip to content
Back to top
View this page

# helpers

chango.helpers.change_uid_from_file(file)

  Get the change note identifier from a file name or path.

  Parameters:

    file (`str` | `pathlib.Path`) – The file name or path to get the identifier from.

  Returns:

    The `uid` of the change note.

  Return type:

    `str`

chango.helpers.ensure_uid(obj)

  Extract the unique identifier of an object. Input of type `str` and `None` is returned unchanged.

  Parameters:

    obj (`str` | `None` | has `uid`) – An object that either has a string attribute `uid` (e.g. `ChangeNote` or `Version`), is a `str` or is `None`.

  Returns:

    The extracted UID if available and `None` else.

  Return type:

    `str` | `None`