Skip to content

binary-butterfly/validataclass-search-queries

Repository files navigation

validataclass Search Queries

Unit tests

Shared Python library for search queries based on 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.

To install it using pip, just run:

pip install validataclass-search-queries

If you add the package to your dependencies, it is recommended to use compatible release version specifiers to make sure you always get the latest version of the library but without running into breaking changes:

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 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 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).

About

Python library for search queries in REST APIs (filters, pagination, sorting) based on validataclass and SQLAlchemy.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors