Metadata-Version: 2.4
Name: neozen
Version: 0.9.1
Summary: Streamlined authentication and authorization for modern Python applications
Author: Stefane Fermigier
Author-email: Stefane Fermigier <sf@abilian.com>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: Session
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: advanced-alchemy>=1.8.2
Requires-Dist: alembic>=1.18
Requires-Dist: anyio>=4.0.0
Requires-Dist: asyncpg>=0.31.0
Requires-Dist: dishka>=1.10.1
Requires-Dist: email-validator>=2.3.0
Requires-Dist: ldap3>=2.9.1
Requires-Dist: litestar[standard]>=2.19.0
Requires-Dist: pwdlib[argon2]>=0.3.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pyjwt>=2.12.1
Requires-Dist: sqlalchemy>=2.0.45
Requires-Dist: uvicorn>=0.40.0
Requires-Dist: neozen[password,phone,totp,oauth-client,webauthn,oidc,ldap,sqlalchemy,peewee,tortoise,databases,flask,starlette,demo] ; extra == 'all'
Requires-Dist: databases[aiosqlite]>=0.9.0 ; extra == 'databases'
Requires-Dist: starlette>=0.40.0 ; extra == 'demo'
Requires-Dist: litestar>=2.0.0 ; extra == 'demo'
Requires-Dist: flask[async]>=3.0.0 ; extra == 'demo'
Requires-Dist: uvicorn>=0.30.0 ; extra == 'demo'
Requires-Dist: jinja2>=3.1.0 ; extra == 'demo'
Requires-Dist: itsdangerous>=2.0.0 ; extra == 'demo'
Requires-Dist: flask[async]>=3.0.0 ; extra == 'flask'
Requires-Dist: ldap3>=2.9.0 ; extra == 'ldap'
Requires-Dist: httpx>=0.28.0 ; extra == 'oauth-client'
Requires-Dist: pyjwt[crypto]>=2.10.0 ; extra == 'oidc'
Requires-Dist: pwdlib[argon2]>=0.3.0 ; extra == 'password'
Requires-Dist: peewee>=3.17.0 ; extra == 'peewee'
Requires-Dist: aiosqlite>=0.21.0 ; extra == 'peewee'
Requires-Dist: phonenumbers>=9.0.0 ; extra == 'phone'
Requires-Dist: sqlalchemy>=2.0.0 ; extra == 'sqlalchemy'
Requires-Dist: advanced-alchemy>=0.30.0 ; extra == 'sqlalchemy'
Requires-Dist: starlette>=0.40.0 ; extra == 'starlette'
Requires-Dist: tortoise-orm[asyncpg]>=0.22.0 ; extra == 'tortoise'
Requires-Dist: aiosqlite>=0.21.0 ; extra == 'tortoise'
Requires-Dist: pyotp>=2.9.0 ; extra == 'totp'
Requires-Dist: qrcode[pil]>=8.0 ; extra == 'totp'
Requires-Dist: webauthn>=2.0.0 ; extra == 'webauthn'
Requires-Python: >=3.12.4
Project-URL: Homepage, https://neozen.lab.abilian.com/
Project-URL: Documentation, https://neozen.lab.abilian.com/
Project-URL: Repository, https://git.sr.ht/~sfermigier/neozen
Project-URL: Changelog, https://git.sr.ht/~sfermigier/neozen/tree/main/item/CHANGES.md
Provides-Extra: all
Provides-Extra: databases
Provides-Extra: demo
Provides-Extra: flask
Provides-Extra: ldap
Provides-Extra: oauth-client
Provides-Extra: oidc
Provides-Extra: password
Provides-Extra: peewee
Provides-Extra: phone
Provides-Extra: sqlalchemy
Provides-Extra: starlette
Provides-Extra: tortoise
Provides-Extra: totp
Provides-Extra: webauthn
Description-Content-Type: text/markdown

# NeoZen

**Authentication and authorization for modern Python applications.**

[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://git.sr.ht/~sfermigier/neozen/tree/main/item/LICENSE)
[![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue.svg)](https://www.python.org/)

NeoZen (**N**eoZe**N** = Auth**N** + Auth**Z**) is a framework-agnostic authentication and authorization toolkit for Python. It is also, secondarily, a lightweight self-hostable identity provider you can stand up in front of one or more apps.

> **Status**: 0.9 is the first public release. Docs, tests, packaging and the reference deployment are in good shape, but 0.9 is not yet semver-stable: the API may evolve before 1.0.

## Two ways to use NeoZen

### As a library

`pip install neozen` and embed it in your own Litestar, Starlette, Flask, or other Python web app. Bring your own User model. Pick the factors and storage backend you need.

```bash
pip install "neozen[sqlalchemy,password]"
```

See the [Developer Quickstart](https://neozen.lab.abilian.com/get-started/quickstart/): a runnable 80-line Litestar app in under five minutes.

### As a self-hosted service

`docker compose up -d` to run NeoZen as its own IAM service with an admin console. Other apps talk to it over standard protocols.

```bash
cd deploy/docker
docker compose up -d
docker compose logs neozen | grep NEOZEN-BOOTSTRAP-CREDENTIALS -A 6
```

See the [Self-Hosted Quickstart](https://neozen.lab.abilian.com/get-started/self-hosted/): a working self-hosted IAM in under ten minutes.

## What NeoZen provides

- **Authentication**: passwords (Argon2id), magic links, TOTP, email OTP, WebAuthn/passkeys, social login (Google, GitHub)
- **Authorization**: role-based access control (RBAC), permissions, policy-based authorization
- **OAuth 2.1 server**: authorization code with PKCE, refresh, client credentials
- **OpenID Connect 1.0 Provider**: discovery, JWKS, ID tokens, UserInfo, consent, RP-initiated logout, dynamic client registration
- **SCIM 2.0 server**: User and Group resources with filter parser
- **LDAP backend**: read-mostly LDAP/Active Directory with bind-based password authentication
- **Sessions, groups, invitations, rate limiting, account lockout, audit logging, i18n**
- **Framework adapters** for Flask, Litestar, Starlette
- **Admin console** (Litestar) with user management, bulk import/export, live audit log, security dashboard
- **Reference deployment**: Dockerfile, docker-compose, starter Helm chart, `neozen serve` production-mode CLI

## Design principles

- **Framework-agnostic**: works with Flask, Litestar, Starlette, or any WSGI/ASGI app
- **Protocol-based**: depend on interfaces, not implementations
- **Bring Your Own Model**: factory functions and split protocols let you plug your own User model without inheriting from NeoZen base classes
- **Secure by default**: Argon2id hashing, timing-safe comparison, rate limiting, account lockout, audit logging
- **Modular**: use only the components you need
- **Type-checked** across mypy, ty, and pyrefly

## Documentation

Full docs at <https://neozen.lab.abilian.com/> (or build locally with `make -C docs serve`).

- [Developer Quickstart (5 min)](https://neozen.lab.abilian.com/get-started/quickstart/)
- [Self-Hosted Quickstart (10 min)](https://neozen.lab.abilian.com/get-started/self-hosted/)
- [Cheat Sheet](https://neozen.lab.abilian.com/guides/cheat-sheet/)
- [Bring Your Own Model](https://neozen.lab.abilian.com/guides/bring-your-own-model/)

## Development

```bash
# Clone
git clone https://git.sr.ht/~sfermigier/neozen
cd neozen

# Install with all extras
uv sync --all-extras

# Run the full test suite
uv run pytest tests/a_unit tests/b_integration tests/c_e2e

# Lint
uv run ruff check

# Build the docs
make -C docs serve
```

## License

Apache License 2.0. See [`LICENSE`](https://git.sr.ht/~sfermigier/neozen/tree/main/item/LICENSE).

NeoZen is sponsored by [Abilian SAS](https://abilian.com). Abilian's interest in NeoZen is in consulting and integration services around the OSS, not in a product upsell. There is no paid tier and no open-core gating.
