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.1.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.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: classmods-1.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 15c75fe09a98d66351b36f3e111eea437f7ccb7e47d56756daa74de655257123
MD5 47a8a78c00283eb19f324274edb6bdf2
BLAKE2b-256 3c8434b61c2c5c1dd4185260726e519b9e474efc69f2831ac844c86f5d2831b0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: classmods-1.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7877dc743598a89fdfd42eae02115823b6a565de0b3dbfe0452d23f335ea3d56
MD5 7bc92c4881a0126040e3362b5c26c87d
BLAKE2b-256 f02de602a7f856bcf5ef78a9cd9922030115b08e73f734b198db877b84a0cee6

See more details on using hashes here.

Provenance

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