{"id":45753,"library":"permit","title":"Permit.io Python SDK","description":"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.","status":"active","version":"2.8.3","language":"python","source_language":"en","source_url":"https://github.com/permitio/permit-python","tags":["authorization","fga","permissions","access-control"],"install":[{"cmd":"pip install permit","lang":"bash","label":"pip"}],"dependencies":[{"reason":"HTTP client for API calls","package":"httpx","optional":false},{"reason":"Data validation","package":"pydantic","optional":false}],"imports":[{"note":"Package name is 'permit', not 'permit_sdk'","wrong":"from permit_sdk import Permit","symbol":"Permit","correct":"from permit import Permit"},{"note":"Models are in submodule permit.models","wrong":"from permit import User","symbol":"User","correct":"from permit.models import User"}],"quickstart":{"code":"import os\nfrom permit import Permit\n\npermit = Permit(\n    token=os.environ.get('PERMIT_KEY', ''),\n    pdp=os.environ.get('PDP_URL', 'http://localhost:7766')\n)\n\nuser = permit.api.users.get_by_key('user@example.com')\nprint(user)\n","lang":"python","description":"Initialize the SDK with a Permit API key and PDP URL."},"warnings":[{"fix":"Use `await permit.check(...)` in async context, or use `permit.check_sync(...)` for synchronous calls.","message":"In versions >=2.0, the SDK migrated from synchronous to async-first design. The old `permit.check()` usage changed.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use `permit.api.users.sync.get_by_key(...)` for synchronous calls, or await `permit.api.users.async_.get_by_key(...)` for async.","message":"The `permit.api.users` endpoint methods have been deprecated in favor of `permit.api.users.sync` or `permit.api.users.async_`.","severity":"deprecated","affected_versions":">=2.5.0"},{"fix":"Ensure PDP is running at the configured URL, or use Permit Cloud PDP by setting `pdp='https://cloudpdp.api.permit.io'`.","message":"The SDK requires a running PDP (Policy Decision Point) locally or a remote PDP URL. Many users get timeout errors without one.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.8.3':16 '3.8':20 'access':30 'access-control':29 'activ':21 'author':12,26 'compat':17 'control':31 'current':14 'develop':22 'fga':27 'fine':10 'fine-grain':9 'frequent':24 'grain':11 'permiss':28 'permit.io':1,7 'python':2,4,19 'releas':25 'sdk':3,5 'servic':13 'version':15","created_at":"2026-06-07T12:56:33.335142+00:00","updated_at":"2026-06-07T12:56:33.335142+00:00","problems":[{"fix":"Install with `pip install permit` and import with `from permit import Permit`.","cause":"Wrong import path; package may be installed incorrectly.","error":"ImportError: cannot import name 'Permit' from 'permit'"},{"fix":"Set the environment variable PERMIT_KEY to your Permit.io API key.","cause":"Invalid or missing PERMIT_KEY environment variable.","error":"PermissionDeniedError: Token not valid"},{"fix":"Start the PDP with `permit-cli pdp run` or set the correct PDP URL.","cause":"PDP is not running or unreachable.","error":"ConnectionError: Cannot connect to PDP at http://localhost:7766"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}