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.0.tar.gz (14.6 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.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: classmods-1.2.0.tar.gz
  • Upload date:
  • Size: 14.6 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.0.tar.gz
Algorithm Hash digest
SHA256 de949341ff028718d6feede2de8fdd820f58c9b41a86e2a24a225ba6bdd49459
MD5 8d814731f844510867f310528a303dcf
BLAKE2b-256 c1ca9edb908bfb20f6cf2feff885eb8534e15ea44888f0d04cc26ceba4bcda00

See more details on using hashes here.

Provenance

The following attestation bundles were made for classmods-1.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: classmods-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aabd33b140da317be55e5b48829f7c0fa8ef89b7da21ab27e41a8fd0f400d479
MD5 569fd4166a933e65bf29a7eb29f0a8ee
BLAKE2b-256 6b5382908f35763525f84f19b31375e4a78c4ab738bfdf08fe5c4394cc57026a

See more details on using hashes here.

Provenance

The following attestation bundles were made for classmods-1.2.0-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