A useful collection of decorators (focused in animation)
Project description
Decorating: A Meta Repo To Decorators
Abstract
This project was encouraging a explore the limits of decorators powers in Python, whose, however is not so knew for everyone (mainly the beginners), is a extremely useful feature of the language similar, whose can be similar of Lisp Macros, but without change the AST. The famous examples is the @animated and @writing decorator. BTW, because is fun too. All the repository is made from scratch, just using the Python stdlib, no dependency!
Installation
INFO: we need some people to do support for Python2, only Python3 for now. Check #3
stable: last release: sudo pip install decorating
bleeding-edge: sudo pip install git+https://www.github.com/ryukinix/decorating
Usage
Public decorators on the API of decorators decorating:
debug
cache
counter
count_time
animated
writing
Examples
Animated
Using as decorator and mixed with context-managers
Well
Using with nested context-managers
Writing
Another project mine called MAL whose is a basic command line interface for MyAnimeList, I recently test the features of @writing only adding 3 lines on my code! Check the awesome effect:
Developers
sudo git clone https://www.github.com/ryukinix/decorating
cd decorating
sudo make develop
The develop mode creates a .egg-info (egg-link) as symlink with your standard site-packages/dist-packages directory. Don’t be worry with the decorating.egg-info, is only information for the package egg to link with your PYTHONPATH. For that, the usage is dynamic, you can modify the code in test on the command line always using absolute imports in anywhere (like the first example)
Contributing
Avoid I blame you. You maybe don’t will like that. I’m not Linus, but I can really do heavy critiques sometimes.[/lain ]. Although I’m joking, keep your life more easy, so setup the pre-commit after clone!
In the root of git repository, do that commands:
sudo pip install pre-commit pylint nose2 pre-commit install
If you don’t know about pre-commit, check pre-commit website.
Now you can create a new branch git checkout -b feature based on the master (or other you wants improves, like dev) and send a pull-request for me!
If you just wants know something, I give a suggestion, create a new issue! I’ll happy with it.
License
MIT
Because good things need 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.