hydra-utils
Wrapper for (hydra-core to add flexible configuration treatment.
Requirement
- Python 3.13, 3.12, 3.11, 3.10
Installation
pip install hydra-utils
Usage
@hydra_utils.hydra_wrapper(
app_name='my_app',
app_version='0.1.0',
app_file=__file__,
config_path='conf',
config_name='config',
verbose=1,
)
def main(conf: dict[Any, Any]) -> None: ...
if __name__ == '__main__':
main()
app_nameandapp_versionare used to log information of current version.- It is useful if app_version is set to
__version__of the app.
- It is useful if app_version is set to
app_fileis used to check the file place's git status to log the git commit hash and diff from the last commit.- The argument which the main function takes is
dict[Any, Any]instead ofDictConfig. - Configuration file can be passed by the first argument or
conf_file=...at the command line, which will be merged to the configuration file specified by conf_path and conf_name. - Configuration file can have
includekeyword which has the list of configuration files to include.- Included files are merged to the main configuration file.
- It is resolved at the place of
include. If the main file has other configurations after theinclude, they will overwrite the included configurations.
n_jobsis fixed to the number of CPUs.- It is used to set the number of jobs for parallel processing.
- If
n_jobsis set to 0 or 1, it is set to 1. - If
n_jobsis set to -1, it is set to the number of logical cores. - If
n_jobsis set to None, it is set to the number of physical cores. - If
n_jobsis set to a negative number, it is set to the number of logical cores + 1 + n_jobs, i.e. -1 is the same as the number of logical cores.
It is recommended to define hydra.job.name in your default configuration file (<conf_pth>/<conf_name>.yaml):
hydra:
job:
name: my_custom_job_name
Otherwise the job name is utils as hydra detect the file where hydra.main is executed.
There is also wrapper function for to_absolute_path.
from hydra_utils import to_absolute_path
- It returns empty string if the input is empty.
- It returns the input as is if the input includes
:(e.g.,http://,s3://, ...).
Based on rcmdnk/python-template, v0.1.2
Metadata
Release files for hydra-utils 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hydra_utils-0.4.1.tar.gz | 126.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hydra_utils-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 136.4 kB
Release files / hydra_utils-0.4.1.tar.gz
| Download URL | hydra_utils-0.4.1.tar.gz |
|---|---|
| Size | 126.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94a25ce35c1143a4e905326b4aa4831ffaf451ab9b868c677ea469ebe162f9e5
|
|
BLAKE2b-256 checksum How to use checksums |
1f02c1794789be42901518ad36507e7c291467c040b4574e2f6d27b092a38c44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / hydra_utils-0.4.1-py3-none-any.whl
| Download URL | hydra_utils-0.4.1-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
097a542f94851b25eafbec2769f78eb759980537ddbeed7e0a5085809718fcf4
|
|
BLAKE2b-256 checksum How to use checksums |
d36f772993ef7d2c51e60ea8ee3233ff30758c8fd73739adda9c5760305c902a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for hydra-utils 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.