bridgekeeper
Django permissions that work with QuerySets.
What it is and what it does
Bridgekeeper is a Django permissions library that lets you define access rules in Python code rather than storing them in the database. Unlike django-rules, it uniquely supports both checking permissions on individual model instances and filtering QuerySets—so you can efficiently retrieve only the records a user is allowed to edit without duplicating permission logic.
The package has no runtime dependencies and installs cleanly. However, it is dormant: the last release was in June 2020 and the last commit in December 2023, with no active maintenance. It was tested on Django 2.2 and 3.0 with Python 3.5–3.8, so compatibility with newer Django or Python versions is unverified.
Use it for:
- Build a list view that shows only the model instances a user has permission to edit, without writing permission checks twice
- Define role-based or attribute-based access rules in code and apply them consistently across instance checks and QuerySet filters
- Migrate from database-stored permissions to code-defined rules for easier version control and testing
- Implement custom permission logic (e.g., 'user can edit their own posts') that works seamlessly with Django ORM queries
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Bridgekeeper provides a permissions system for Django projects where permissions are defined in code rather than the database, and crucially, works on both individual model instances and QuerySets.
Yes, if you are on Django 2.2 or 3.0 and Python 3.5–3.8 and need QuerySet-aware permissions. The permissive MIT license and zero runtime dependencies make it low-risk. However, dormancy since 2020 means no support for newer Django or Python versions—verify compatibility with your stack before committing, and be prepared to maintain a fork if you need to upgrade Django.
Install
bridgekeeper on PyPI
pip
pip install bridgekeeperuv
uv add bridgekeeperpoetry
poetry add bridgekeeperInstalling bridgekeeper
Before you install
Installation is straightforward with no runtime dependencies. The package is dormant—last release was 2020-06-28 and last commit 2023-12-15—so expect no active maintenance or updates, though the repository remains unarchived.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute the package freely in commercial and private projects without restriction.
Quickstart
pip install bridgekeeper
from bridgekeeper import rules
# Define a permission rule in code
rules.add_rule('can_edit_post', lambda user, post: post.author == user)
# Check permission on a QuerySet
allowed_posts = Post.objects.filter(rules.Q('can_edit_post', user=request.user))
Requires Django 2.2 or 3.0 and Python 3.5 or later; the package is not tested against newer Django versions.
Verify before relying
- Compatibility with Django versions released after 3.0 (package last tested on 3.0)
- Whether the package works with modern Python versions beyond 3.8
- Current state of the codebase and whether dormancy indicates stability or abandonment
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 2,238 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 74,556/month — #14,817 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bridgekeeper-0.9-py3-none-any.whl
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
rulesrules provides object-level permission checking…
permissive · top 15,000 on PyPI
djangorestframework-role-filtersAdds role-based access control to Django REST…
permissive · top 5,000 on PyPI
dry-rest-permissionsDefines rules-based permissions for Django REST…
permissive · top 15,000 on PyPI
djangorestframework-guardianIntegrates django-guardian's object-level…
permissive · top 15,000 on PyPI
django-guardiandjango-guardian adds per-object permission…
permissive · top 5,000 on PyPI
rest_conditionProvides logical operators (And, Or, Not) to…
permissive · top 15,000 on PyPI
django-query-builderBuilds and executes complex SQL queries…
permissive · top 15,000 on PyPI
zope.securityProvides a generic security framework for…
unclear · top 15,000 on PyPI
django-cryptographyWraps Python's cryptography library to add…
permissive · top 15,000 on PyPI
django-robotsA Django application that manages robots.txt…
permissive · top 15,000 on PyPI