Skip to main content

Python.png

Permit.io Python SDK

Python SDK for interacting with the Permit.io full-stack permissions platform.

Installation

pip install permit

Documentation

Read the documentation at Permit.io website

Upgrading from 2.x

permit 3.0.0 requires Python 3.10 or later and raises the minimum versions of its dependencies. The migration guide lists every breaking change, who it affects and what to change. To have an AI agent such as Claude Code do the upgrade, use the permit-python-3-migration skill.

Type checking

The package ships a py.typed marker (PEP 561), so mypy, pyright and IDEs check your calls into the SDK against its type annotations. No pydantic mypy plugin is needed.

  • The SDK's models are pydantic v1 models under both pydantic majors (with pydantic 2 installed they come from pydantic.v1), and type checkers see them that way: use .dict() and .json() on them, not .model_dump().
  • Methods that take a model also accept an equivalent dict, such as permit.api.users.create({"key": "user"}), and bulk methods take a list of either. The dict is still validated at runtime.
  • Model constructors are typed by their fields, so a nested model field takes a model instance, not a dict: ResourceCreate(key="doc", name="Doc", actions={"read": ActionBlockEditable()}). pydantic accepts a nested dict there at runtime, but a type checker rejects it. To pass plain dicts, give the whole payload to the API method as a dict instead.
  • The blocking client, permit.sync.Permit, is typed as blocking: permit.api.users.get("user") returns a UserRead, not a coroutine.

Deprecations

A future major release, permit 4.0, will remove the following. They still work in 3.x, and each one issues a DeprecationWarning that says what to do instead.

  • pydantic 1 support. On pydantic 1, import permit warns once. Upgrade to pydantic 2. The SDK's models then come from pydantic.v1, so their methods stay the same, but invalid input raises pydantic.v1.ValidationError rather than pydantic.ValidationError. Catching pydantic.v1.ValidationError works under both majors. Until you upgrade, the warning filter ignore:Support for pydantic 1:DeprecationWarning silences the import warning.
  • The flat methods on permit.api, such as permit.api.get_user(). Use the grouped APIs instead, such as permit.api.users.get(). Each flat method's warning names its replacement.

By default, Python shows these warnings only when the code that triggers them is in __main__, such as the script you run. pytest shows them in its warnings summary. To see them elsewhere, such as in a web app, run Python with -W default::DeprecationWarning or set the environment variable PYTHONWARNINGS=default::DeprecationWarning.

Metadata

Release files for permit 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for permit 3.0.0
File Size Uploaded
permit-3.0.0.tar.gz 150.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for permit 3.0.0
File Interpreter ABI Platform
permit-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 258.7 kB

Release files / permit-3.0.0.tar.gz

Download URL permit-3.0.0.tar.gz
Size 150.2 kB
Tags Source
SHA-256 checksum
How to use checksums
49a6be8285f083847cce34416663829747b1452576bb587382380488b13af316
BLAKE2b-256 checksum
How to use checksums
5a61a911cd5f18eff59ef98aefcf3d87ad56666bb7d405942787b6b4a8686aa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / permit-3.0.0-py3-none-any.whl

Download URL permit-3.0.0-py3-none-any.whl
Size 108.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
138cea9006202d1bf6a0625aa964c1de2db0e5e9344c47864ede1cc66183adba
BLAKE2b-256 checksum
How to use checksums
b46125ed8dc480d1561442d125fb91d081f9812994c5711d63ba792fee15192c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.8.3

2 release files

2.8.2

2 release files

2.8.1

2 release files

2.8.0

2 release files

2.7.5

2 release files

2.7.4

2 release files

2.7.3

2 release files

2.7.2

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.5

2 release files

2.6.4

2 release files

2.6.3

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.5.0

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

1 release file

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page