Permguard Python SDK
The official synchronous Python client for the stateless Permguard PDP
interface permguard.api.pdp.native.v1.
The same API supports both server bindings:
http://andhttps://use JSON;grpc://andgrpcs://usepermguard.data.v1.PolicyDecisionPoint.
Installation
pip install permguard
Python 3.8 or newer is required.
Evaluate one request
from permguard import Action, Client, Entity, EvaluateRequest
with Client("grpc://localhost:7443") as client:
response = client.evaluate(
EvaluateRequest(
zone="acme",
ledger="documents",
subject=Entity(type="user", id="amy@example.com"),
resource=Entity(type="document", id="quarterly-report"),
action=Action(name="read"),
)
)
print("permitted:", response.decision)
Use http://localhost:7443 to send the same request over HTTP/JSON. A deny is a
successful response whose decision is False. Validation, authorization,
availability, and server failures raise permguard.Refusal, preserving their
stable class and code.
Partition inputs
Runtime data is addressed to the partition name declared by the ledger profile:
from permguard import PartitionInput
request.partition_inputs["authorization"] = PartitionInput(
type="permguard.cedar.entities.v1",
data=[
{
"uid": {"type": "Team", "id": "engineering"},
"attrs": {"active": True},
"parents": [],
}
],
)
The key selects a partition already declared by the profile. The input type
is checked against that declaration; it does not select a runtime.
Evaluate a batch
from permguard import (
Action,
Entity,
EvaluateRequest,
Evaluation,
EvaluationOptions,
EvaluationsSemantic,
)
response = client.evaluate_many(
EvaluateRequest(
zone="acme",
ledger="documents",
subject=Entity(type="user", id="amy@example.com"),
evaluations=[
Evaluation(
resource=Entity(type="document", id="one"),
action=Action(name="read"),
request_id="one",
),
Evaluation(
resource=Entity(type="document", id="two"),
action=Action(name="read"),
request_id="two",
),
],
options=EvaluationOptions(
evaluations_semantic=EvaluationsSemantic.EXECUTE_ALL,
),
)
)
Call client.get_configuration() to read the interface discovery document.
The client reuses its HTTP connection or gRPC channel; use it as a context
manager or call close().
Static HTTP headers and gRPC metadata can be supplied through headers. HTTPS
accepts an ssl.SSLContext; gRPCS accepts grpc.ChannelCredentials.
Compatibility
This major version implements permguard.api.pdp.native.v1. Compatibility is
tied to that versioned interface rather than to a server minor release.
Development and release
hatch run protoc
hatch run dev
hatch -e lint run all
hatch build
The existing tag-based PyPI workflow remains the release mechanism. The
package version is still read from permguard/__about__.py and set from the
release tag.
License
Apache License 2.0. See LICENSE and THIRD_PARTY_NOTICES.md.
Metadata
Release files for permguard 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| permguard-0.1.1.tar.gz | 32.5 kB | With provenance | Details for permguard-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| permguard-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for permguard-0.1.1-py3-none-any.whl |
Total release size: 57.5 kB
Release files / permguard-0.1.1.tar.gz
| Download URL | permguard-0.1.1.tar.gz |
|---|---|
| Size | 32.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14c6c285849c9f50592fce9159a5956e28be2ffed41f50205e5df3a8e3d7bb43
|
|
BLAKE2b-256 checksum How to use checksums |
8f24fcf409c964e3cf2d10d17336fd9b5f5db8c6e7fe87e553463324637bdb68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / permguard-0.1.1-py3-none-any.whl
| Download URL | permguard-0.1.1-py3-none-any.whl |
|---|---|
| Size | 25.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
efd55adfef7adf34e280dc4aa0f0231a4f599dcca5d9d298ecb8528aefc676c0
|
|
BLAKE2b-256 checksum How to use checksums |
b27c8df14e9eedc2d56b5414f4c4a050927b10fdb9bb92200dcb422872e967da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for permguard 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for permguard-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.