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
pip install therismos
Optional extras:
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
Release files for therismos 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| therismos-1.1.0.tar.gz | 103.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| therismos-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 175.2 kB
Release files / therismos-1.1.0.tar.gz
| Download URL | therismos-1.1.0.tar.gz |
|---|---|
| Size | 103.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46d298e299dca5d327eb30f9dee24c5669d7f3273a0862da745f6544548dbb5e
|
|
BLAKE2b-256 checksum How to use checksums |
2201de8e1738e71cd12329061656bd946e6c08e787eba4376d2ad62a78875311
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / therismos-1.1.0-py3-none-any.whl
| Download URL | therismos-1.1.0-py3-none-any.whl |
|---|---|
| Size | 71.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3dc5396d62cb1a26caab8efc1b354c3bcc0a8c7ab21b21de77a7957afd35b33f
|
|
BLAKE2b-256 checksum How to use checksums |
82532e509dcd01e219e5d2331f45e94c7cdb45439c2f37d780f09fb6a3c292a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|