Skip to main content

pydecos - is a set of useful decorators.

  • deprecate: to deprecate class/method/function. Deprecation reason can be specified.
  • ...

Installation

For most users, the recommended method to install is via pip:

pip install pydedecos

or from a source:

python setup.py install

Import

from pydecos import deprecated

Usage examples

- @deprecated

  • function
from pydecos import deprecated


@deprecated
def some_func(t):
  print('weeeee' * t)


some_func(3)
# <input>:1: DeprecationWarning: Call to deprecated function some_func.
# weeeeeweeeeeweeeee
  • class
from pydecos import deprecated


@deprecated
class SomeClass:
    def some_method(self):
        ...


SomeClass()
# DeprecationWarning: Deprecated class has been invoked "SomeClass".
# SomeClass()
  • method
from pydecos import deprecated


class SomeClass:

    @deprecated
    def some_method(self):
        ...


SomeClass().some_method()
# DeprecationWarning: Deprecated function/method "some_method" has been invoked.
# SomeClass().some_method()
  • deprecation with reason specified
from pydecos import deprecated


@deprecated('Use the new function "awesome_func()" instead')
def some_func(t):
  return t


some_func(3)
# DeprecationWarning: Deprecated function/method "some_func" has been invoked: Use the new function "awesome_func()" instead.
#  some_func(3)

- @timestamp

from pydecos import timestamp


@timestamp
def some_func(t):
  return t


some_func(3)
print(some_func.created_at)

# 2021-01-15 20:58:45.071720

- @count_call

from pydecos import count_call


@count_call
def some_func():
  pass


some_func()
some_func()
some_func()
print(some_func.counter)
# 3

Changelog

0.0.2 (15.01.2021)

Added new decorators

  • time_limit (linux only)
  • count_call
  • timestamp
  • timer
  • makebold
  • makeitalic
0.0.1 (14.01.2021)
  • initial commit

Metadata

Release files for pydecos 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydecos 0.0.2
File Size Uploaded Provenance Actions
pydecos-0.0.2.tar.gz 3.5 kB Without provenance Details for pydecos-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydecos 0.0.2
File Interpreter ABI Platform Actions
pydecos-0.0.2-py3-none-any.whl Python 3 none any Details for pydecos-0.0.2-py3-none-any.whl

Total release size: 6.8 kB

Release files / pydecos-0.0.2.tar.gz

Download URL pydecos-0.0.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
14bf02184ec10b5fd6bcaba272370f1845b3358cc39a907b9b0dbb60b2e0b7f7
BLAKE2b-256 checksum
How to use checksums
5cddf2a8cf736d65e26312bdef19c4feef1f0bd2501366458569628234b87464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

Release files / pydecos-0.0.2-py3-none-any.whl

Download URL pydecos-0.0.2-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac92a8477639226f4470d8d801b6905a7217097314eef3334dd8eeeb00835441
BLAKE2b-256 checksum
How to use checksums
4dd571dd9d2e676c8de477e908a1546dd75034271bc8b5c2a48dee17f894327c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

Security for pydecos 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page