Metadata-Version: 2.4
Name: authplane-sdk
Version: 0.2.0
Summary: Authplane SDK for Python — OAuth 2.1 JWT validation and token operations for protected resources
Project-URL: Homepage, https://github.com/AuthPlane/python-sdk
Project-URL: Repository, https://github.com/AuthPlane/python-sdk
Project-URL: Issues, https://github.com/AuthPlane/python-sdk/issues
Project-URL: Changelog, https://github.com/AuthPlane/python-sdk/blob/main/CHANGELOG.md
Author: Authplane Team
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: authentication,authorization,jwt,mcp,oauth
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: authlib>=1.3
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: coverage>=7; extra == 'dev'
Requires-Dist: cryptography>=42; extra == 'dev'
Requires-Dist: pyright>=1.1; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# authplane-sdk

[![PyPI](https://img.shields.io/pypi/v/authplane-sdk?style=flat-square&label=authplane-sdk)](https://pypi.org/project/authplane-sdk/)
[![Python versions](https://img.shields.io/pypi/pyversions/authplane-sdk?style=flat-square)](https://pypi.org/project/authplane-sdk/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue?style=flat-square)](https://opensource.org/licenses/Apache-2.0)

Framework-agnostic OAuth 2.1 JWT validation and token operations for Python resource servers.

## Install

```bash
pip install authplane-sdk
```

## Quickstart

```python
import asyncio
from authplane import ASCredentials, AuthplaneClient


async def main():
    client = await AuthplaneClient.create(
        issuer="https://auth.example.com",
        auth=ASCredentials(client_id="my-resource", client_secret="s3cret"),
    )

    res = client.resource(
        resource="https://api.example.com",
        scopes=["read", "write"],
    )

    claims = await res.verify(incoming_jwt)
    print(claims.sub, claims.scopes)

    await client.aclose()


asyncio.run(main())
```

Call `await client.aclose()` on shutdown to stop background JWKS and metadata refresh tasks.

## Documentation

Full API reference, configuration options, error hierarchy, DPoP, token operations, introspection, token exchange, and advanced usage: **[User Guide](https://github.com/AuthPlane/python-sdk/blob/main/authplane/docs/user-guide.md)**.
