Skip to main content

Changes

This repo has diverged from the original fork. It includes expanded parsing rules; see 0.1.1 changes in the CHANGELOG. It has also been restructured as a standalone pypi package called marvin-sqlalchemy-boolean-search, as its primary use is for https://github.com/sdss/marvin. For a more general standalone package, see https://github.com/havok2063/boolean_parser, which rebuilds this repo functionality into a fully fledged python package.

This repo is maintained at https://github.com/havok2063/SQLAlchemy-boolean-search, with changes pushed occassionally.

SQLAlchemy-boolean-search

SQLAlchemy-boolean-search translates a boolean search string such as:

"field1=*something* and not (field2==1 or parent.field3<=10.0)"

into its corresponding SQLAlchemy query filter:

and_(DataModel.field1.ilike('%something%'),
     not_(or_(DataModel.field2.__eq__(2),
              DataModel.parent.field3.__le__(10.0))))

Relationship field names such as 'parent.grandparent.name' are accepted.

The code is stable, is used in production, and enjoys a test coverage of 100%.

Documentation

SQLAlchemy-boolean-search documentation

Authors

  • Ling Thio - ling.thio [at] gmail.com

Acknowledgements

This project would not be possible without the use of the following amazing offerings:

Alternative modules

Metadata

Release files for marvin-sqlalchemy-boolean-search 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for marvin-sqlalchemy-boolean-search 0.2.2
File Size Uploaded
marvin-sqlalchemy-boolean-search-0.2.2.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for marvin-sqlalchemy-boolean-search 0.2.2
File Interpreter ABI Platform
marvin_sqlalchemy_boolean_search-0.2.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 18.8 kB

Release files / marvin-sqlalchemy-boolean-search-0.2.2.tar.gz

Download URL marvin-sqlalchemy-boolean-search-0.2.2.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c9d5718c49994b1ff8ce666b86e7ff010f8733f96c07b0484e544e0e94545683
BLAKE2b-256 checksum
How to use checksums
8be48543cd5a537f0feaf79c12aa0efb4db8fd8b94a234cac374b9444c73adab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0.post20200209 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

Release files / marvin_sqlalchemy_boolean_search-0.2.2-py2.py3-none-any.whl

Download URL marvin_sqlalchemy_boolean_search-0.2.2-py2.py3-none-any.whl
Size 9.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c195a716cc4c2013a6dc49d2dcb219eb24e1bd96ade81c7e5650c20fcc528096
BLAKE2b-256 checksum
How to use checksums
7ab2839ae624e47a2bba1a50e7c77b182ddad96ff962443826f1319f1265ba61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0.post20200209 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page