Skip to main content

Handy ready-to-use decorators.

Project description

coverage report

decorit

The documentation including examples can be found here.

This is a package with handy ready-to-use decorators for daily scripting and maintaining packages. Decorator requests are highly appreciated, simply open an issue.

If you want to learn how to write your own decorators I recommand to head over to realpython and check out this article. In case you are looking for an wrapper to easily write decorators for your own, you might checkout pydecor.

This project is in an alpha stage, hence it is neither stable nor ready for production.

CAUTION: Starting from version 1.0.0 API-breaking changes will be made only in major releases. Until then, it can be changed in every minor release (see changelog).

Features

Existing decorators:

  • copy_doc: copy docstring of existing function
  • copy_doc_params: copy parameters of docstring of existing function
  • deprecated: print deprecated warning on call
  • alias: give multiple names to function, e.g. short and long
  • logging: logging call of functions
  • time: timeing execution of function
  • run_once: run function only once at first call

Usage

Installation

python3 -m pip install decorit

Usage

import decorit

# start decorating your functions

Building Documentation:

The doc is based on pdoc and can be created by simply running bash create_doc.sh from the docs folder. For dependencies see in the CI action.

Similar Projects

Credits:

In alphabetical order:

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

decorit-0.2.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

decorit-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file decorit-0.2.0.tar.gz.

File metadata

  • Download URL: decorit-0.2.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for decorit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 67280fdfb47f9d503c62bdfcc4b22903c43f6bcd2e2f4cd22dd7ee4f2f23e52e
MD5 b758ccd53e8908e5ac506f8dda4a5679
BLAKE2b-256 9a31aa65c4eaaaa50df4aaeef93da8827f58a31e5be1eaeab21a7f4a45803a15

See more details on using hashes here.

File details

Details for the file decorit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: decorit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for decorit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1acdf52d9713199e357166d3f8a50317cbea78559a2dbbc6399ce9385a0bc78
MD5 5ed60cc55f3f0373483d301dfe2a2aa4
BLAKE2b-256 b47efde4910d15ba7c05feb25d293434db2b61ee5cea5f50827cdf25ddf96b37

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page