Utils

class neptune.git_info.GitInfo(commit_id, message='', author_name='', author_email='', commit_date='', repository_dirty=True)[source]

Bases: object

Class that keeps information about a git repository in experiment.

When create_experiment() is invoked, instance of this class is created to store information about git repository. This information is later presented in the experiment details tab in the Neptune web application.

Parameters
  • commit_id (str) – commit id sha.

  • message (str, optional, default is "") – commit message.

  • author_name (str, optional, default is "") – commit author username.

  • author_email (str, optional, default is "") – commit author email.

  • commit_date (datetime.datetime, optional, default is "") – commit datetime.

  • repository_dirty (bool, optional, default is True) – True, if the repository has uncommitted changes, False otherwise.

neptune.utils.get_git_info(repo_path=None)[source]

Retrieve information about git repository.

If attempt fails, None will be returned.

Parameters

repo_path (str, optional, default is None) –

Path to the repository from which extract information about git.
If None is passed, calling get_git_info is equivalent to calling git.Repo(search_parent_directories=True). Check GitPython docs for more information.

Returns

GitInfo - An object representing information about git repository.

Examples

# Get git info from the current directory
git_info = get_git_info('.')