Metadata-Version: 2.4
Name: django-grid-view
Version: 1.0.0
Summary: Declarative grid views for Django: Simple Table, AG-Grid helpers, KPI cards, ECharts, and an LLM-friendly GridViewSpec contract
Author-email: Oleksii Pylypchuk <alpi@keemail.me>
License-Expression: MIT
Project-URL: Homepage, https://github.com/alpiua/django-grid-view
Project-URL: Repository, https://github.com/alpiua/django-grid-view
Project-URL: Documentation, https://alpiua.github.io/django-grid-view/
Project-URL: Issues, https://github.com/alpiua/django-grid-view/issues
Project-URL: Changelog, https://github.com/alpiua/django-grid-view/blob/main/CHANGELOG.md
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django<6.0,>=4.2
Provides-Extra: static-charts
Requires-Dist: matplotlib>=3.8; extra == "static-charts"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6; extra == "docs"
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Provides-Extra: dev
Requires-Dist: basedpyright>=1.28.0; extra == "dev"
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: django-stubs>=5.1.0; extra == "dev"
Requires-Dist: matplotlib>=3.8; extra == "dev"
Requires-Dist: matplotlib-stubs>=0.3.11; extra == "dev"
Requires-Dist: mkdocs>=1.6; extra == "dev"
Requires-Dist: mkdocs-material>=9.5; extra == "dev"
Requires-Dist: pre-commit>=4.0.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-django>=4.8.0; extra == "dev"
Requires-Dist: ruff>=0.8.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Requires-Dist: typing_extensions>=4.12.0; extra == "dev"
Dynamic: license-file

# Django Grid View

[![PyPI](https://img.shields.io/pypi/v/django-grid-view.svg)](https://pypi.org/project/django-grid-view/)
[![CI](https://github.com/alpiua/django-grid-view/actions/workflows/ci.yml/badge.svg)](https://github.com/alpiua/django-grid-view/actions/workflows/ci.yml)
[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://alpiua.github.io/django-grid-view/)

Declarative grid views for Django: **Simple Table**, **AG-Grid** helpers (HTMX-safe), **KPI** cards, **ECharts** charts, and an LLM-friendly **GridViewSpec** contract.

**Full documentation:** [https://alpiua.github.io/django-grid-view/](https://alpiua.github.io/django-grid-view/)

## Install

```bash
pip install django-grid-view
```

## Quick start

```python
# settings.py
INSTALLED_APPS = ["django_grid_view"]

# urls.py
urlpatterns = [path("", include("django_grid_view.urls"))]
```

```python
from django_grid_view.tables import Column, SimpleTableConfig

config = SimpleTableConfig(
    grid_id="demo",
    columns=[Column(key="name", label="Name")],
    data=[{"name": "Ada"}, {"name": "Bob"}],
)
```

```django
{% load django_grid_view %}
{% render_simple_table config %}
```

Run `python manage.py migrate django_grid_view` if you use saved AG-Grid preferences.

## Features

| Feature | Docs |
|---------|------|
| Simple Table (sort, search, export) | [Simple Table](https://alpiua.github.io/django-grid-view/simple-table/) |
| AG-Grid + HTMX | [AG-Grid integration](https://alpiua.github.io/django-grid-view/ag-grid/) |
| KPI + charts + unified artifact | [Grid View artifacts](https://alpiua.github.io/django-grid-view/grid-view-artifacts/) |
| Python types (pyright/mypy) | [Python types](https://alpiua.github.io/django-grid-view/reference/python-types/) |
| Release notes | [Changelog](https://alpiua.github.io/django-grid-view/changelog/) |

## Development

Requires [uv](https://docs.astral.sh/uv/). The lockfile (`uv.lock`) pins all dev tools; CI uses `uv sync --frozen --group dev`.

```bash
uv sync --group dev
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run basedpyright --warnings src/django_grid_view tests
```

Docs site (MkDocs):

```bash
./scripts/docs_serve.sh
```

Or manually (always use `uv run mkdocs`, not a global install):

```bash
uv sync --group dev
uv run python scripts/build_llm_context.py
uv run mkdocs build --strict
uv run mkdocs serve
```

Without uv: `pip install -e ".[dev]"` then the same `pytest` / `ruff` / `basedpyright` commands.

**LLM agents:** full doc bundle → [`docs/llm/django-grid-view-llm-context.md`](docs/llm/django-grid-view-llm-context.md) ([skill](https://alpiua.github.io/django-grid-view/llm/skill/)).

## Release

Tag `v*` on `main` — CI publishes to PyPI via trusted publishing (`environment: pypi`).

Documentation: push to `main` runs [`.github/workflows/docs.yml`](.github/workflows/docs.yml) (`mkdocs build --strict` → GitHub Pages). Enable **Settings → Pages → GitHub Actions** once per repository.

## License

MIT — see [LICENSE](LICENSE).
