optunahub.load_module

optunahub.load_module(package: str, *, repo_owner: str = 'optuna', repo_name: str = 'optunahub-registry', ref: str = 'main', base_url: str = 'https://api.github.com', force_reload: bool = False, auth: Auth | None = None) ModuleType

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 – The base URL for the GitHub API.

  • 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 is required to access private/internal repositories.

Returns:

The module object of the package.