Skip to main content

A Python library that provides decorators for converting regular modules into callable modules

Project description

Cadule

Cadule (short for Ca[llableMo]dule) is a Python library that transforms regular modules into callable objects. By using the decorators provided by cadule, you can make entire modules callable just like functions.

Usage

Example File: hello.py

import cadule

@cadule
def __call__():
    print("Hello World!")

Python REPL Interaction

>>> import hello
>>> hello()
Hello World!
>>> # Now the entire hello module has become a callable object
>>> callable(hello)
True
>>> # You can still access other attributes in the module (if any exist)

As shown above, by simply applying the decorator, the entire hello module becomes a callable object, and calling it executes the decorated __call__ function.

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

cadule-0.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

cadule-0.0.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file cadule-0.0.1.tar.gz.

File metadata

  • Download URL: cadule-0.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cadule-0.0.1.tar.gz
Algorithm Hash digest
SHA256 95aa7c467c67c19c392d091f0567a5a2d883cf35b69c64abfb668f4f77867b5e
MD5 a1631bddf5701ef642bfc58db2bcfc80
BLAKE2b-256 42b1d09010dcce164eeda7ceec92d3cca739ee30c0b1d6203b9589819b57a8c5

See more details on using hashes here.

File details

Details for the file cadule-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: cadule-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cadule-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 265ff4b32db09adced2b0111fd6e283a14f24340e0a9235c74c4b3f944f33916
MD5 2b7a609febdc822f41451ad2010eaa2e
BLAKE2b-256 1e3de219e5fa6792de1aaf3826398014365ea880a4e17c0bfbb797e4d2ea24ab

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