A set of helper functions
Project description
Custom Helpers
A small Python utility package providing helper functions for configuration management and import utilities.
Installation
pip install custom_helpers
Features
Configuration Management
Load configuration from YAML files with omegaconf:
from custom_helpers import get_config
# Load configuration file with automatic root_dir setting
config = get_config("path/to/conf.yaml")
# Or specify a custom root directory
config = get_config("path/to/conf.yaml", root="/custom/root/path")
Python Path Utilities
Add the project root directory to the Python path:
from custom_helpers import add_root_to_pythonpath
# Add the current directory to Python path
add_root_to_pythonpath()
# Add a parent directory to Python path (go up n levels)
add_root_to_pythonpath(n_up=1)
# Get the root directory path
root_dir = add_root_to_pythonpath(return_root=True)
# Print the added directory
add_root_to_pythonpath(verbose=True)
Note:
add_root_to_pythonpathis designed for script use and will raise an error if used in Jupyter/IPython environments.
Requirements
- Python 3.10+
- omegaconf
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file custom_helpers-0.1.0.tar.gz.
File metadata
- Download URL: custom_helpers-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6c8e26ebfa36eb88c0db06f4d396dbe4a053ed3c39ca6d066f153dc1bf92dc8
|
|
| MD5 |
af19d5bc51c9628e287eebab695b6955
|
|
| BLAKE2b-256 |
59962070e4620735039c7092338ca58d870d1d5548f4ccd0586ac06b056b6332
|
File details
Details for the file custom_helpers-0.1.0-py3-none-any.whl.
File metadata
- Download URL: custom_helpers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33537abd2bfd349e2231620ed9c7bfa540177391c8c68579f7d02e17d06e052c
|
|
| MD5 |
30dde7c9e745c09f3795225ce52068f8
|
|
| BLAKE2b-256 |
eaf75aef22faa60cb54e2ca7a2bea55cc6190015e28aa3f77604e4f624f2dc91
|