A useful collection of decorators (focused in animation)
Project description
Decorating: A Meta Repo To Decorators
Abstract
This project encourages an exploration into the limits of decorators in Python. While decorators might by new to beginners, they are an extremely useful feature of the language. They can be similar to Lisp Macros, but without changes to the AST. Great decorators from this packages are @animated and @writing. This repository is made from scratch, just using Python’s Standard Library, no dependency!
Examples
Animated
Using as decorator and mixed with context-managers
Using with nested context-managers
Writing
Another project mine called MAL uses the decorating package —- basically a command line interface for MyAnimeList. The decorator @writing can be used by just adding 3 lines of code! The behavior is a retro typing-like computer. Check out the awesome effect:
More examples are covered on my personal blog post about decorating.
Decorators & Usage
Currently public decorators on the API of decorators decorating:
decorating.debug
decorating.cache
decorating.counter
decorating.count_time
decorating.animated
decorating.writing
Mostly decorators has a pretty consistent usage, but for now only animated and writing has support to use as contextmanagers using the with syntax.
Installation
Supported Python versions:
Python3.4+
Python2.7
You can install the last release on PyPI by calling:
pip install --user decorating
If you want get the last development version install directly by the git repository:
pip install --user git+https://www.github.com/ryukinix/decorating
We have a published package on Arch Linux,which you can install using your favorite AUR Helper, like pacaur or yaourt:
yaourt -S python-decorating
Though since the version 0.6 we have support for Python2.7, an AUR package for Python2 was not made yet. Fill a issue if you have interest on that :). Thanks to Maxim Kuznetsov which implemented the necessary changes to make compatible with Python2!
License
Because good things need to be free.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file decorating-0.6.1.tar.gz
.
File metadata
- Download URL: decorating-0.6.1.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 766edff30a305a1530b3dc8f2e84d9f764a370060c251c1f4258917ad3734883 |
|
MD5 | 9434f04a77ed2b7afae4f3f53f8f1ed0 |
|
BLAKE2b-256 | 543a3cb70592ff7208f38af494479f3ab19c124ad028c550f36ebee0ab4443a4 |
File details
Details for the file decorating-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: decorating-0.6.1-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0644af54d972fbb8a685fcf07086d3102c95f766be9429c62ff6897014c3c88a |
|
MD5 | b8195c40c852762c8b5cd0cab1481dde |
|
BLAKE2b-256 | 25ef1c4ccaace65fcd109cd9a8ffa0f0c658207f81ec684aedc9a40ff0fe5e12 |