Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scriputils-0.2.6.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scriputils-0.2.6-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file scriputils-0.2.6.tar.gz.

File metadata

  • Download URL: scriputils-0.2.6.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.13.1 Darwin/23.6.0

File hashes

Hashes for scriputils-0.2.6.tar.gz
Algorithm Hash digest
SHA256 1c16bfc0d99c4b59bfc48a93abdd87458e758de1385488995cc7681481a073b7
MD5 72e3145c446bd14c2d4372ea2628ba86
BLAKE2b-256 363ada4bbf750eb6427e1f201aa28565328d43074edcb4b4fc596e4244ccdaf7

See more details on using hashes here.

File details

Details for the file scriputils-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: scriputils-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.13.1 Darwin/23.6.0

File hashes

Hashes for scriputils-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fc1ce24e552cb54a386e5cc0697e5ae5bbca96b6c3e6b5b03d9e558ec2892601
MD5 683067c19d472bbb1bc10ff62c8d22ad
BLAKE2b-256 ce80eec59cf68d4048331f056a24e5383ed73e92f7885db1fa451f72a6470790

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page