Skip to main content

A lightweight utilities package for managing configuration and logging across multiple projects. It provides a simple interface to create and access configuration files in various formats, along with a straightforward logging system that can optionally centralize logs and configs in a single location.

Project description

Utilities

A lightweight utilities package for managing configuration and logging across multiple projects. It provides a simple interface to create and access configuration files in various formats, along with a straightforward logging system that can optionally centralize logs and configs in a single location.

Version

Installation

You can install the package via pip from git:

pip install utilities-toolkit

Or with uv:

uv add git+https://github.com/themateam-lib/utilities.git@v0.1.6

Main Features

  • Dynamic configuration access: Read and write INI, JSON, and Python files for centralized settings.
  • Advanced logging: Flexible logging setup, Rich formatting for readable and colored logs.
  • File copy with progress: Copy files with Rich progress bars and automatic backup of existing files.
  • Utility functions: Folder creation, path manipulation, and more.

Exported Functions & Classes

Config

Configuration manager for your projects. Example:

from utilities import Config
Config.ensure_initialized("my_project", {"Section": {"Key": "Value"}})

# Then access it like this:
value = Config.my_project.Section.Key

It will create an ini config file in a project-specific folder in utilities folder at the root of your user directory.

Making it useful for storing project-specific settings.

LoggingConfigurator

Flexible logging setup with Rich formatting. Example:

from utilities import LoggingConfigurator
LoggingConfigurator.configure(project="my_project", level="DEBUG", console=True, log_file=True)

Useful to centralize logging configuration, but especially log files in a project-specific folder in utilities folder at the root of your user directory.

with_spinner

Context manager to display a Rich spinner during long operations. Example:

from utilities import with_spinner
with with_spinner("Processing..."):
    # your code

utilities_specific_folder

Returns the path to a project-specific folder, creating it if necessary. Example:

from utilities import utilities_specific_folder
folder = utilities_specific_folder("my_folder")

Useful for storing files related to your project in a dedicated folder within the utilities directory.

Structure

  • src/utilities/ : main source code
  • src/utilities/config/ : configuration management
  • src/utilities/log/ : logging and utilities
  • tests/ : unit tests

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

utilities_toolkit-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

utilities_toolkit-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file utilities_toolkit-0.1.0.tar.gz.

File metadata

  • Download URL: utilities_toolkit-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for utilities_toolkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 efe6797584251177f86042d9a48b3eb6350511afbad055109ff8db6c7b3b20c1
MD5 735c30228bed8c07874ebafd582b743b
BLAKE2b-256 842f6165bfaa2e2ffabb2e5e38374ba347ecd725a8fd494816dcb518c39d9885

See more details on using hashes here.

File details

Details for the file utilities_toolkit-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for utilities_toolkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78604d3db17e446f59ba7f4ff7eaea0c9a85d317286c27b5601986f1b9d61d6f
MD5 a57a628a4ecfd8437e94bb5a215d6f7f
BLAKE2b-256 f28301b204a006d2db603b2e648ac0655bf13aee6beec7536a29d0c98b122ad2

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