optunahub.load_module

optunahub.load_module(package: str, *, repo_owner: str = 'optuna', repo_name: str = 'optunahub-registry', ref: str = 'main', base_url: str | None = None, force_reload: bool = False, auth: Auth | None = None) ModuleType[source]

Import a package from the OptunaHub registry. The imported package name is set to optunahub_registry.package.<package>. A third-party registry is also available by setting the repo_owner and repo_name.

Parameters:
  • package – The package name to load.

  • repo_owner – The owner of the repository.

  • repo_name – The name of the repository.

  • ref – The Git reference (branch, tag, or commit SHA) for the package.

  • base_url – If auth is None and the git command is available, this should be the base URI for the remote repository. In this case, specifying SSH endpoints, such as git@github.com, git@gitlab.example.com, or other custom domains and similar services, allows access to private/internal repositories via SSH. Otherwise, this should be the base URL for the GitHub API, such as https://api.github.com, https://gitlab.example.com/api/v4/, or other custom domains and similar services, depending on your setup.

  • force_reload – If True, the package will be downloaded from the repository. If False, the package cached in the local directory will be loaded if available.

  • authThe authentication object for the GitHub API. It also allows access to access private/internal repositories via the GitHub API.

Returns:

The module object of the package.