Skip to main content

Simple mods for python classes.

Project description

classmods

classmods is a lightweight Python package designed to enhance class behavior with minimal effort. It provides modular decorators and descriptors to automate and simplify class-related tasks like environment variable management, creating example env files, monitoring, logging, and more.

Documentation

All features are well documented and use a high level of type_hints for easy understanding and usage.

Features

(Click names for more information)

  • classproperty: A descriptor that lets you define class‑level computed attributes with a simple decorator syntax.
  • ConstantAttrib: A descriptor that acts like a constant. Once set, the value cannot be changed. Raises AttributeError on change detection.
  • ENVMod: The main API class for managing .env variables. Supports manual and decorator-based registration of environment items, type-safe value loading, and .env_example generation.
  • logwrap: A dynamic decorator to log function calls. Uses the logging module with your current project configurations.
  • MethodMonitor: A class to monitor method calls of a target class, triggering a handler function after the method is called.
  • RemoteAttrib: A descriptor that acts as a remote attribute. You can modify the mapped value on-the-fly.
  • SuperWith: A powerful context manager utility that allows you to combine multiple context managers into a single with or async with statement.
  • suppress_errors: A decorator that suppresses exceptions raised by the wrapped function and returns a fallback value instead.

Installation

  1. Easy install with pip
pip install classmods
  1. Install with git+pip
pip install git+https://github.com/devixa-tech/classmods

License

MIT License


Made with ❤️ by devixa

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

classmods-1.3.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

classmods-1.3.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file classmods-1.3.0.tar.gz.

File metadata

  • Download URL: classmods-1.3.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for classmods-1.3.0.tar.gz
Algorithm Hash digest
SHA256 4143014d4aa513f68e365cf31719ba4f6d06cfaef1ad787c7bb2e2935c161317
MD5 b159fde3ec0bd3f70ce61ced81d9b11f
BLAKE2b-256 17910a474609993af6ee8089d4f3161f9bbfe2d25259ab76439c2daa2cf854ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for classmods-1.3.0.tar.gz:

Publisher: python-publish.yml on devixa-tech/classmods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file classmods-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: classmods-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for classmods-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 061df910724d40b1c80346350d4ed0fb743dd2f001d0e7437f93d50e0ab46e9d
MD5 2b941ffe574ce1d34ed7a59d2e23e24c
BLAKE2b-256 cb83efdcb5f70d79d55c35243474f21f4677a87fb11799bafe1a4f479e0c6836

See more details on using hashes here.

Provenance

The following attestation bundles were made for classmods-1.3.0-py3-none-any.whl:

Publisher: python-publish.yml on devixa-tech/classmods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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