Skip to main content

Library to help developers to create filter for the sqlachemy orm.

Project description


license wheel pyversions


The purpose of this project is to set the basic class so that you can create a tree that will be then used to filter a request made with the SQLAlchemy ORM.

Currently, the elements provided are as Follows:

  • the nodes (see: the table Below)
  • the class SqlaFilterTree which contains the tree and allows to print it.
  • the class BaseSqlaParser which serves as the basis if you create a parser that allows generating a tree.

This project is also for me a way to experience the namespace packages.


pip install sqla-filters


The following operators are or will be implemented:

support operators name code
[x] like like like()
[x] eq equal operators.eq
[x] not_eq not equal
[x] null null is None
[x] not_null not null is not None
[x] gt greater than
[x] gte greater than or equal
[x] lt lower than
[x] lte lower than or equal operators.le
[x] in in in_()
[x] not_in not in ~.in_()
[x] contains contains operators.contains


This is an example of what a tree looks like.

                                      |                      |
                                      |          and         |
                                      |                      |
                    +----------------------+     ||     +----------------------+
                    |                      |     ||     |                      |
                    |          or          <------------>      age == 21       |
                    |                      |            |                      |
                    +----------------------+            +----------------------+
+----------------------+       ||       +----------------------+
|                      |       ||       |                      |
|     name == toto     <---------------->     name == tata     |
|                      |                |                      |
+----------------------+                +----------------------+


You can contribute to the project using different ways.

1 | Classical

Fork the repository and run the following command to install the dependencies and the dev dependencies.

pip install -e '.[dev]'

Pipenv Pipefile is also available if needed.

2 | Using namespace features

If you want to contribute using the namespace features it's really simple. First create your own project and use the following directories structure.


This is an example to create new parser.

You can find example with the following repositories:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sqla-filters, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size sqla_filters-0.0.2-py3-none-any.whl (9.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size sqla-filters-0.0.2.tar.gz (8.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page