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)

  • ConstantAttrib: A descriptor that acts like a constant. Once set, the value cannot be changed. Raises AttributeError on change detection.
  • RemoteAttrib: A descriptor that acts as a remote attribute. You can modify the mapped value on-the-fly.
  • 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.
  • MethodMonitor: A class to monitor method calls of a target class, triggering a handler function after the method is called.
  • logwrap: A dynamic decorator to log function calls. Uses the logging module with your current project configurations.
  • 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/hmohammad2520-org/classmods

License

MIT License


Made with ❤️ by hmohammad2520

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.2.2.tar.gz (15.1 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.2.2-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for classmods-1.2.2.tar.gz
Algorithm Hash digest
SHA256 0bf8774c22e6ef020521d8066cb3c95b4e78ed6397f11da59d222a4775a3c81e
MD5 8c0b8f53cc7c7af089d42679af7dc143
BLAKE2b-256 94ec19025ce82579e7bfedf0ac10ee0e54694f4e4d840462f75bf0b04b5e4740

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on hmohammad2520-org/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.2.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for classmods-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9a3443aae7128e02ba522a897e0070fd2661d72c2185a9e1d6f756ffee44221d
MD5 f3176ac47059ceddce240b29cbb192f7
BLAKE2b-256 e043416adb09a9e40f035de6875a276c22aecee7722e31fafa531cacba25ccb8

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on hmohammad2520-org/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