skillfed

rest_condition

Complex permissions flow for django-rest-framework

rest-condition v1.0.3 94.0K downloads/30d#13,356 on PyPI279
Permissive license MIT Abandoned released

What it is and what it does

rest_condition is a small utility library that adds boolean logic operators to permission systems. It provides And, Or, and Not operators to build complex permission expressions—for example, allowing access if (Perm1 AND Perm2) OR (NOT Perm2). The library wraps individual permission classes and composes them into a single permission that evaluates the full expression.

The package has no runtime dependencies. However, it has been abandoned since 2016 and its classifiers declare support only through Python 3.4, making it a legacy tool. If your project runs on modern Python versions, you should verify compatibility before relying on it in production.

Use it for:

  • Build permission rules that require multiple conditions to be true simultaneously.
  • Negate a permission to deny access when a condition is met.
  • Combine permission checks with OR logic to allow access if any one of several conditions is satisfied.
  • Express complex multi-condition access policies without writing custom permission classes for every combination.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides logical operators (And, Or, Not) to compose complex permission checks in Django REST Framework views, allowing you to combine multiple permission classes with boolean logic.

No, unless you are maintaining legacy code already using this package. The library is abandoned (last release 2016-11-01, last commit 2019-01-04) and declares support only through Python 3.4. Modern projects should implement permission composition directly or use actively maintained alternatives. If you must use it, verify compatibility with your current Python and framework versions before deploying.

Install

rest-condition on PyPI

pip

pip install rest-condition

uv

uv add rest-condition

poetry

poetry add rest-condition

Installing rest_condition

Before you install

High install friction: no runtime dependencies but the package is abandoned (last commit 2019-01-04, 3573 days without release). Classifiers declare support only through Python 3.4, which is severely outdated. Installation will succeed but the codebase is unmaintained.

License in practice

MIT license is permissive and poses no restrictions on use or redistribution. You may use, modify, and distribute this package freely in commercial or private projects.

Quickstart

pip install rest_condition

from rest_condition import ConditionalPermission, C, And, Or, Not

# Compose permission expressions
permission_classes = [Or(And(Perm1, Perm2), Not(Perm2))]

Requires Django and django-rest-framework to be installed separately; no explicit version constraints are declared in the package metadata.

Verify before relying

  • Whether the package works correctly with modern Python versions despite classifiers only listing through Python 3.4.
  • Whether the package is compatible with current versions of the frameworks it depends on.
  • Whether there are known bugs or edge cases in the boolean permission composition logic.

Package facts

License MIT (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 3,573 days since the last release
Last repo commit
First released
Downloads 93,960/month — #13,356 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rest_condition-1.0.3.tar.gz

Development Status :: 5 - Production/StableFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4

Tags

django rest framework permissionsconditional permissions logiccombine permission classesboolean permission operatorscomplex permission flowdjango api permissions
djangopermissionslegacy

More Application Frameworks packages