rules is a tiny but powerful app providing object-level permissions to Django, without requiring a database. At its core, it is a generic framework for building rule-based systems, similar to decision trees. It can also be used as a standalone library in other contexts and frameworks. Versatile. Decorate callables to build complex graphs of predicates. Predicates can be any type of callable -- simple functions, lambdas, methods, callable class objects, partial functions, decorated functions, anything really. A good Django citizen. Seamless integration with Django views, templates and the Admin for testing for object-level permissions. Efficient and smart. No need to mess around with a database to figure out whether John really wrote that book. Simple. Dive in the code. You'll need 10 minutes to figure out how it works. Powerful. rules comes complete with advanced features, such as invocation context and storage for arbitrary data, skipping evaluation of predicates.
Features
- Documented, tested, reliable and easy to use
- A good Django citizen
- Efficient and smart
- rules requires Python 3.7 or newer
- Comes complete with advanced features, such as invocation context and storage for arbitrary data
- Dive in the code