Metadata-Version: 2.4
Name: validataclass_search_queries
Version: 0.6.1
Summary: Python library for search queries in REST APIs (filters, pagination, sorting) based on validataclass and SQLAlchemy.
Home-page: https://github.com/binary-butterfly/validataclass-search-queries
Author: binary butterfly GmbH
Author-email: lexi.stelter@binary-butterfly.de
License: MIT
Project-URL: Documentation, https://github.com/binary-butterfly/validataclass-search-queries/blob/main/docs/index.md
Project-URL: Changelog, https://github.com/binary-butterfly/validataclass-search-queries/blob/main/CHANGELOG.md
Project-URL: Issue Tracker, https://github.com/binary-butterfly/validataclass-search-queries/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
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: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: ~=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typing-extensions~=4.15
Requires-Dist: validataclass<0.14.0,>=0.12.0
Requires-Dist: sqlalchemy<2.1,>=1.4
Provides-Extra: testing
Requires-Dist: pytest~=9.0.3; extra == "testing"
Requires-Dist: pytest-cov~=7.1.0; extra == "testing"
Requires-Dist: coverage~=7.13.5; extra == "testing"
Requires-Dist: flake8~=7.3.0; extra == "testing"
Requires-Dist: mypy~=1.20.1; extra == "testing"
Dynamic: license-file

# validataclass Search Queries

[![Unit tests](https://github.com/binary-butterfly/validataclass-search-queries/actions/workflows/tests.yml/badge.svg)
](https://github.com/binary-butterfly/validataclass-search-queries/actions/workflows/tests.yml)

Shared Python library for search queries based on [validataclass](https://github.com/binary-butterfly/validataclass).

Implements search filters, pagination and sorting using dataclasses and validators, and provides helpers to work with
database queries (currently SQLAlchemy 1.4 and 2.0 are supported, however, support for SQLAlchemy 1.4 is deprecated now).

**Status:** Beta.


## Installation

validataclass-search-queries is available on [PyPI](https://pypi.org/project/validataclass-search-queries/).

To install it using [pip](https://pip.pypa.io/en/stable/getting-started/), just run:

```shell
pip install validataclass-search-queries
```

If you add the package to your dependencies, it is recommended to use
[compatible release](https://www.python.org/dev/peps/pep-0440/#compatible-release) version specifiers to make sure you
always get the latest version of the library but without running into breaking changes:

```shell
pip install validataclass-search-queries~=0.6.0
```

However, keep in mind that the library is still in its beta phase (as indicated by the major version of 0). There can
and will be smaller breaking changes between 0.x minor versions, but we will try to keep them at a minimum and save the
big breaking changes for the release of version 1.0.0.


## Usage

See [docs](https://github.com/binary-butterfly/validataclass-search-queries/blob/main/docs/index.md) for
the documentation, including a quick tutorial on how to use this library.


## Development

### Virtual environment

To setup a virtualenv for development of the library, run `make venv`.

This will create a virtualenv in `venv` and install the package in edit mode inside the virtualenv, including testing
dependencies.


### Running unit tests

Unit tests can be run using `make tox` or by directly executing `tox`.

For this to work you need to either be inside the virtualenv (see above) or have [tox](https://tox.wiki/en/latest/)
installed in your system locally.

Take a look at the `Makefile` for more ways to run the unit tests (e.g. inside a Docker container to test for specific
Python versions).
