Metadata-Version: 2.5
Name: caxton
Version: 0.2.3
Summary: A declarative way to describe files in Python
Project-URL: Homepage, https://github.com/dzhalaevd/caxton
Project-URL: Repository, https://github.com/dzhalaevd/caxton
Project-URL: Issues, https://github.com/dzhalaevd/caxton/issues
Author: David Dzhalaev
License-Expression: MIT
License-File: LICENSE
Keywords: declarative,files,validation
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: openpyxl<4.0,>=3.1.5
Requires-Dist: typing-extensions<5,>=4.15; python_version < '3.11'
Requires-Dist: xlsxwriter<4.0,>=3.2.9
Provides-Extra: hypothesis
Requires-Dist: hypothesis<7.0,>=6.165; extra == 'hypothesis'
Description-Content-Type: text/markdown

# Caxton

[![CI][ci-shield]][ci-url]
[![Codecov][codecov-shield]][codecov-url]
[![PyPI version][pypi-shield]][pypi-url]
[![Python versions][python-shield]][pypi-url]
[![License: MIT][license-shield]][license-url]

---

Declarative Python library for describing and generating documents
from application data. Users define the document structure and semantics, while
renderers handle output formats and backend-specific details

| Stable `v1.0.0` will be released when we decide, that no longer want to freely change the public DSL |
|------------------------------------------------------------------------------------------------------|

[📚 Documentation](https://dzhalaevd.github.io/caxton/)\
[📑 Changelog](CHANGELOG.md)

```python
from caxton import render, sheet, spreadsheet, table, text, write

rows = [{"name": "Ada Lovelace"}, {"name": "Grace Hopper"}]

report = spreadsheet(
    sheet(
        "People",
        table(
            source=rows,
            columns=(text(source="name", title="Name"),),
        ),
    ),
)

result = render(report)

write(report, "people.xlsx")
```

More examples are available in the [example projects](example)

The project is licensed under the [MIT](LICENSE)

## Installation

Install Caxton with pip:

```
pip install caxton
```

No additional setup is required

<div align="center">

### Works on Open-Source

If you find this project interesting, consider giving it a ⭐

</div>

[ci-shield]: https://github.com/dzhalaevd/caxton/actions/workflows/ci.yml/badge.svg

[ci-url]: https://github.com/dzhalaevd/caxton/actions/workflows/ci.yml

[codecov-shield]: https://codecov.io/gh/dzhalaevd/caxton/graph/badge.svg

[codecov-url]: https://codecov.io/gh/dzhalaevd/caxton

[pypi-shield]: https://img.shields.io/pypi/v/caxton.svg

[pypi-url]: https://pypi.org/project/caxton/

[python-shield]: https://img.shields.io/pypi/pyversions/caxton.svg

[license-shield]: https://img.shields.io/badge/License-MIT-yellow.svg

[license-url]: LICENSE
