An essential utility library for Python scripts, offering robust functions for reading YAML configurations, initializing loggers, and parsing command-line arguments.
Project description
util_kit
An essential utility library for Python scripts, offering robust functions for reading YAML configurations, initializing loggers, and parsing command-line arguments.
Installation
pip install scriputils
Usage in your Python script
from pathlib import Path
from scriputils import get_config, get_logger, get_kwargs
if __name__ == '__main__':
# getting default config path
file_path = Path(__file__)
config_path = file_path.parent / (file_path.stem + '_config.yaml')
kwargs = get_kwargs(config_path).parse_args()
# Read configurations from a YAML file
config = get_config(kwargs.config_path)
LOGGER = get_logger(
logger_name=config['logger_name'],
path=Path("logs"),
level=kwargs.logger_level,
add_stdout=False
)
LOGGER.info("Logger initialized")
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 scriputils-0.3.0.tar.gz.
File metadata
- Download URL: scriputils-0.3.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a7b4b1fb082108a55a5f62300c5f324581febcff49cf9e240e6fa56816801ce
|
|
| MD5 |
e7dd0136745af917d0feeb2813eb95b5
|
|
| BLAKE2b-256 |
cb968d1b5cbf92232d9fbb888b9ceaf8fa7de49f3a12d5a2feabdef4e9257628
|
File details
Details for the file scriputils-0.3.0-py3-none-any.whl.
File metadata
- Download URL: scriputils-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a993a0778183e5d0c01c92c1f35ca8186aa2b649fa5956dbb1f33757ffaf64d
|
|
| MD5 |
4373e77e514fa2cfc72b840fc2c488e6
|
|
| BLAKE2b-256 |
73f59ef9bb2f9c6f7307cdad2a3a97e596f5d7b0f782a590677dab32e67114ca
|