skillfed

bridgekeeper

Django permissions that work with QuerySets.

bridgekeeper v0.9 74.6K downloads/30d#14,817 on PyPI48
Permissive license MIT DORMANT released

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 bridgekeeper

uv

uv add bridgekeeper

poetry

poetry add bridgekeeper

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8

Tags

django permissions querysetcode-based django authorizationdjango access controldjango permission filteringqueryset permission checkingdjango rules alternativemodel instance permissions
django-permissionsaccess-controlqueryset-filtering

More Dynamic Content packages