Metadata-Version: 2.4
Name: therismos
Version: 1.1.0
Summary: A Python library for modeling queries, filters, expressions, grouping, and aggregations as object structures
Project-URL: Repository, https://gitlab.com/Kencho1/therismos
Project-URL: Homepage, https://gitlab.com/Kencho1/therismos
Project-URL: Issues, https://gitlab.com/Kencho1/therismos/-/issues
Project-URL: Documentation, https://therismos.readthedocs.io
Author: Jesús Alonso Abad
License: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT 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: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: tatsu~=5.8
Provides-Extra: dev
Requires-Dist: mypy~=1.5; extra == 'dev'
Requires-Dist: pytest-cov~=4.1; extra == 'dev'
Requires-Dist: pytest~=7.4; extra == 'dev'
Requires-Dist: ruff~=0.1; extra == 'dev'
Requires-Dist: tox~=4.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material; extra == 'docs'
Provides-Extra: mongodb
Requires-Dist: pymongo~=4.0; extra == 'mongodb'
Provides-Extra: mongodb-async
Requires-Dist: motor~=3.0; extra == 'mongodb-async'
Provides-Extra: pandas
Requires-Dist: pandas; extra == 'pandas'
Requires-Dist: pandas-stubs; extra == 'pandas'
Provides-Extra: polars
Requires-Dist: polars; extra == 'polars'
Provides-Extra: sqlalchemy
Requires-Dist: sqlalchemy>=2.0; extra == 'sqlalchemy'
Description-Content-Type: text/markdown

# Therismos

> **θερισμός** — _Greek; noun_ — Harvest.

A Python library for modeling queries, filters, expressions, grouping, and aggregations as object structures.

## Features

- **Backend-agnostic modeling**: Build expressions, filters, sorting, and aggregations independent of any specific backend
- **Declarative DSL**: Natural Python syntax for building complex queries
- **Type safety**: Optional field type declarations with automatic casting
- **Immutable structures**: All nodes are immutable and thread-safe
- **Powerful optimizer**: Detects contradictions, tautologies, and simplification opportunities
- **Grammar-based serialization**: Convert expressions to/from compact strings for URLs and APIs
- **Visitor pattern**: Extensible architecture for converting to any backend format
- **Multiple backends**: MongoDB, Polars, pandas, SQLAlchemy, SQLModel, and custom backends
- **Expression templates**: Parameterized, persistable filter expressions with a transform pipeline DSL
- **Grouping and aggregation**: Model grouping and aggregation criteria as objects
- **Sorting specifications**: Model sort criteria as objects with optimization and visitor support
- **Field pruning**: Remove or project field-based constraints with polarity-aware semantics

## Installation

```bash
pip install therismos
```

Optional extras:

```bash
pip install therismos[mongodb]        # PyMongo / Motor
pip install therismos[polars]         # Polars DataFrames
pip install therismos[pandas]         # pandas DataFrames
pip install therismos[sqlalchemy]     # SQLAlchemy / SQLModel
```

## Documentation

Full documentation is available at <https://therismos.readthedocs.io>.

## License

MIT
