apache / apache/casbin-rs

[feature] Python bindings via PyO3

Open
#418 1 comment 0 reactions 1 assignee Claimed by @hsluoyz View on GitHub
question
Dominant language
Rust
Stars
1.1k
Forks
94
PR merge metrics
No merged PRs in 30d

Description

## Summary

Would there be interest in Python bindings for casbin-rs using [PyO3](https://github.com/PyO3/pyo3)?

## Motivation

- The existing pure-Python [pycasbin](https://github.com/casbin/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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.