Metadata-Version: 2.5
Name: hxadmin
Version: 0.1.0
Summary: Admin interface for FastAPI and SQLAlchemy 2.0+, built with Tailwind CSS and htmx
Project-URL: Homepage, https://github.com/gledi-ai/hxadmin
Project-URL: Documentation, https://github.com/gledi-ai/hxadmin/tree/main/docs
Project-URL: Source, https://github.com/gledi-ai/hxadmin
Project-URL: Issues, https://github.com/gledi-ai/hxadmin/issues
Project-URL: Changelog, https://github.com/gledi-ai/hxadmin/blob/main/CHANGELOG.md
Author: Gledi Caushaj
License-Expression: MIT
License-File: LICENSE
Keywords: admin,fastapi,htmx,sqlalchemy,tailwind
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: AsyncIO
Classifier: Framework :: FastAPI
Classifier: Framework :: Pydantic :: 2
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: anyio<5.0,>=4.10
Requires-Dist: fastapi<1.0,>=0.139
Requires-Dist: jinja2<4.0,>=3.1.6
Requires-Dist: markupsafe<4.0,>=3.0
Requires-Dist: pydantic<3.0,>=2.12
Requires-Dist: python-multipart<1.0.0,>=0.0.30
Requires-Dist: sqlalchemy[asyncio]<3.0,>=2.0.45
Requires-Dist: starlette<2.0,>=1.2
Provides-Extra: xlsx
Requires-Dist: xlsxwriter<4,>=3.2; extra == 'xlsx'
Description-Content-Type: text/markdown

# hxadmin

Admin interface for FastAPI and async SQLAlchemy 2.0+, built with Jinja2, htmx, Alpine.js and Tailwind CSS.

List, detail, create, edit and delete from class attributes, with search, sort, pagination, per-column filters, row and bulk actions, custom pages, CSV / Excel export and light / dark themes. Async only and fully typed.

## Install

```bash
pip install hxadmin            # CSV export included
pip install 'hxadmin[xlsx]'    # adds Excel export
```

## Quickstart

```python
from fastapi import FastAPI
from hxadmin import HxAdmin, ModelView

app = FastAPI()
admin = HxAdmin(app, session=get_session, auth=current_admin_user, title="My admin")


@admin.register
class UserView(ModelView[User]):
    model = User
    list_columns = ("email", "name", "group")
    searchable = ("email", "name")
    list_filters = ("active", "group")
    export_formats = ("csv", "xlsx")
```

`session` yields an `AsyncSession`; `auth` returns the current user or raises `HTTPException(401)`. Open `/admin/`.

Documentation: [docs](https://github.com/gledi-ai/hxadmin/tree/main/docs) (build locally with `nox -s docs`). Try everything in the demo: `uv run python -m demo`, then open http://127.0.0.1:8001/admin/. For projects built on plain Core `Table`s instead of ORM models, see `uv run python -m demo_tables` (http://127.0.0.1:8002/admin/).

## Development

```bash
uv sync            # installs the dev group (lint + test + ipython)
prek install       # git hooks: ruff, pyrefly, uv-lock
nox                # lint + tests on every supported Python
nox -s tests-3.14  # single Python version
nox -s tests_lowest  # tests against the lowest supported dependency versions
nox -s tests_latest  # tests against the newest allowed releases (weekly in CI)
nox -s wheel       # tests against the built wheel
nox -s audit       # dependency vulnerability audit
nox -s docs        # build the docs strictly into site/
nox -s css         # rebuild hxadmin.css after template changes (needs Node.js)
```

Versions come from git tags (`v0.1.0`) via uv-dynamic-versioning.
