Skip to main content

Boolean search expression parser for SQLAlchemy

Project description

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

Project details


Download files

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

Source Distribution

SQLAlchemy-boolean-search-0.1.1.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file SQLAlchemy-boolean-search-0.1.1.tar.gz.

File metadata

File hashes

Hashes for SQLAlchemy-boolean-search-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c15a1f02621618392864b185d18c53e0e2408d03210a0d2ff1b8ed3c2e8179c7
MD5 7bc01d7c784d7d5bbaf5240b637a67c6
BLAKE2b-256 b734b8247624445be395042208201786e771079002b7ad122054e40b1c4ce1c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page