Registry / security / permit

permit

JSON →
library2.8.3pypypi✓ verified 83d ago

Python SDK for Permit.io, a fine-grained authorization service. Current version 2.8.3, compatible with Python >=3.8. Active development with frequent releases.

pip install permit
INSTALL
IMPORT
SIG · PERMIT
P
permit
securitypythonv2.8.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Permit
from permit import Permit
from permit_sdk import Permit
Package name is 'permit', not 'permit_sdk'
User
from permit.models import User
from permit import User
Models are in submodule permit.models

Initialize the SDK with a Permit API key and PDP URL.

import os from permit import Permit permit = Permit( token=os.environ.get('PERMIT_KEY', ''), pdp=os.environ.get('PDP_URL', 'http://localhost:7766') ) user = permit.api.users.get_by_key('user@example.com') print(user)
Debug
Known issues
breakingIn versions >=2.0, the SDK migrated from synchronous to async-first design. The old `permit.check()` usage changed.
fix
Use `await permit.check(...)` in async context, or use `permit.check_sync(...)` for synchronous calls.
affects: >=2.0.0
deprecatedThe `permit.api.users` endpoint methods have been deprecated in favor of `permit.api.users.sync` or `permit.api.users.async_`.
fix
Use `permit.api.users.sync.get_by_key(...)` for synchronous calls, or await `permit.api.users.async_.get_by_key(...)` for async.
affects: >=2.5.0
gotchaThe SDK requires a running PDP (Policy Decision Point) locally or a remote PDP URL. Many users get timeout errors without one.
fix
Ensure PDP is running at the configured URL, or use Permit Cloud PDP by setting `pdp='https://cloudpdp.api.permit.io'`.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'Permit' from 'permit'
Wrong import path; package may be installed incorrectly.
fix
Install with `pip install permit` and import with `from permit import Permit`.
PermissionDeniedError: Token not valid
Invalid or missing PERMIT_KEY environment variable.
fix
Set the environment variable PERMIT_KEY to your Permit.io API key.
ConnectionError: Cannot connect to PDP at http://localhost:7766
PDP is not running or unreachable.
fix
Start the PDP with `permit-cli pdp run` or set the correct PDP URL.
Upgrade
Version history
2.8.3latest on PyPI · released Sep 25, 2025
Audit
Dependencies
httpxrequiredHTTP client for API calls
pydanticrequiredData validation
Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources

No resource links recorded.

permit — pip install permit · libregistry