Boolean search expression parser for SQLAlchemy
Project description
SQLAlchemy-boolean-search translates a boolean search expression such as:
field1=*something* and not (field2==1 or field3<=10.0)
into its corresponding SQLAlchemy filter.
Install
pip install sqlalchemy-boolean-search
Usage example
from sqlalchemy_boolean_search import parse_boolean_search # DataModel defined elsewhere (with field1, field2 and field3) from app.models import DataModel # Parse boolean search into a parsed expression boolean_search = 'field1=*something* and not (field2==1 or field3<=10.0)' parsed_expression = parse_boolean_search(boolean_search) # Retrieve records using a filter generated by the parsed expression records = DataModel.query.filter(parse_expression.filter(DataModel))
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for SQLAlchemy-boolean-search-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | caa6fe693fb5c133b137cd46fea4d599222cb6fe19870d4ed15b97f4816b89e8 |
|
MD5 | 8a6488076a49472aace6cceba64dab5a |
|
BLAKE2b-256 | a97c6d1422d0c6f064a8bcf0137d5b516ce98eb9779e35a3d8da9b601020c13e |