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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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