skillfed

openfga-sdk

A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar.

openfga-sdk v0.10.4 1.0M downloads/30d#4,494 on PyPI86
Permissive license Apache-2.0 Active released

What it is and what it does

The openfga-sdk is an autogenerated Python wrapper around the OpenFGA API, a fine-grained authorization engine inspired by Google's Zanzibar. It provides an async client for managing authorization stores, models, and relationship tuples, and for performing authorization checks (including batch checks), expansions, and queries. The SDK handles credential flows (API token, client credentials, OAuth2), retries failed requests automatically, and integrates with OpenTelemetry for observability.

You initialize a single OpenFgaClient with your API endpoint and credentials, then use it to read/write authorization models, manage relationship tuples (the core permission data), and run authorization queries like checking whether a user has a specific permission. The client is designed for reuse across your application to avoid initialization overhead and maximize connection pooling.

Use it for:

  • Implement role-based or relationship-based access control (RBAC/ReBAC) in a web application by checking permissions before granting access to resources.
  • Manage complex permission hierarchies where permissions depend on relationships between users, roles, and resources.
  • Batch-check permissions for multiple user-resource pairs in a single operation to reduce API call overhead.
  • Query authorization models to expand what permissions a user has or list all objects they can access.
  • Integrate fine-grained authorization into microservices by centralizing permission logic in OpenFGA and querying it from multiple services.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python SDK for OpenFGA that wraps the OpenFGA API, enabling fine-grained authorization checks, relationship tuple management, and authorization model operations through an async client.

Yes. The SDK is actively maintained, has no known vulnerabilities, installs with low friction, and is licensed permissively. It is the canonical Python client for OpenFGA and suitable for production use if you are already running or planning to run an OpenFGA authorization service. Install it only if you have an OpenFGA instance to connect to.

Install

openfga-sdk on PyPI

pip

pip install openfga-sdk

uv

uv add openfga-sdk

poetry

poetry add openfga-sdk

Installing openfga-sdk

Before you install

Low friction install with a pure-Python wheel and four lightweight runtime dependencies. The package is actively maintained with a recent release 46 days ago and supports current Python versions (3.10–3.14).

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install openfga_sdk

from openfga_sdk import ClientConfiguration, OpenFgaClient

async def main():
    config = ClientConfiguration(api_url="https://api.fga.example", store_id="store_id")
    async with OpenFgaClient(config) as client:
        models = await client.read_authorization_models()
        return models

Requires Python 3.10 or later; async/await syntax required; OpenFGA API endpoint and store ID must be configured.

Verify before relying

  • Exact scope of OpenTelemetry integration and what observability signals are exported.
  • Performance characteristics and latency impact of the default retry strategy (up to 3 retries on 429/5xx).
  • Whether connection pooling behavior is configurable or automatic via aiohttp.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — aiohttp, opentelemetry-api, python-dateutil, urllib3
Maintenance actively maintained — 46 days since the last release
Last repo commit
First released
Downloads 1,020,393/month — #4,494 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openfga_sdk-0.10.4-py3-none-any.whl

Keywords: authorization, fga, fine-grained-authorization, openfga, rebac, zanzibar

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

fine-grained authorization pythonopenfga sdkzanzibar authorizationpermission checking apirelationship-based access controlrebac python clientauthorization model management
authorizationfine-grained-access-controlasync-client

More Security packages