Skip to content

[feature] Python bindings via PyO3 #418

@martinadamsdev

Description

@martinadamsdev

Summary

Would there be interest in Python bindings for casbin-rs using PyO3?

Motivation

  • The existing pure-Python pycasbin works well, but a Rust-backed binding would offer significantly better enforcement throughput for high-traffic services.
  • PyO3 + maturin makes it straightforward to publish a pip install-able wheel to PyPI.
  • Other Rust projects (e.g., pydantic-core, ruff, polars) have demonstrated this pattern successfully.

Rough Scope

  1. A PyO3 wrapper around the core casbin API — Enforcer, model/policy loading, enforce(), RBAC role management.
  2. Publish to PyPI with pre-built wheels for Linux / macOS / Windows via maturin + GitHub Actions.

Questions for the Community

  • Is this something people would find useful?
  • Should it live in this repo (as a workspace crate) or in a separate repo?
  • Which subset of the API would be most valuable to expose first?
  • Anyone interested in collaborating on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions