Metadata-Version: 2.1
Name: marvin-sqlalchemy-boolean-search
Version: 0.2.2
Summary: Boolean search expression parser for SQLAlchemy
Home-page: http://github.com/havok2063/SQLAlchemy-boolean-search
Author: Brian Cherinka
Author-email: bcherinka@stsci.edu
License: BSD 3-Clause License
Project-URL: Repository, http://github.com/havok2063/SQLAlchemy-boolean-search
Keywords: Boolean search Flask SQLAlchemy
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Flask
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=2.7
Description-Content-Type: text/markdown
Requires-Dist: pyparsing (<3.0,>=2.4)
Requires-Dist: sqlalchemy (<1.4,>=1.3)
Provides-Extra: dev
Requires-Dist: Sphinx (<4.0,>=2.1.0) ; extra == 'dev'
Requires-Dist: ipython (>=7.9.0) ; extra == 'dev'
Requires-Dist: matplotlib (>=3.1.1) ; extra == 'dev'
Requires-Dist: flake8 (>=3.7.9) ; extra == 'dev'
Requires-Dist: doc8 (>=0.8.0) ; extra == 'dev'
Requires-Dist: pytest (>=5.2.2) ; extra == 'dev'
Requires-Dist: pytest-cov (>=2.8.1) ; extra == 'dev'
Requires-Dist: pytest-sugar (>=0.9.2) ; extra == 'dev'
Requires-Dist: isort (>=4.3.21) ; extra == 'dev'
Requires-Dist: codecov (>=2.0.15) ; extra == 'dev'
Requires-Dist: coverage[toml] (>=5.0) ; extra == 'dev'
Requires-Dist: ipdb (>=0.12.3) ; extra == 'dev'
Requires-Dist: invoke (>=1.3.0) ; extra == 'dev'
Requires-Dist: twine (>=3.1.1) ; extra == 'dev'
Requires-Dist: wheel (>=0.33.6) ; extra == 'dev'
Requires-Dist: Flask (>=1.0) ; extra == 'dev'
Requires-Dist: Flask-SQLAlchemy (>=1.0) ; extra == 'dev'
Requires-Dist: pytest-flask (>=0.8.1) ; extra == 'dev'
Provides-Extra: docs
Requires-Dist: Sphinx (<4.0,>=2.1.0) ; extra == 'docs'

# 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](http://sqlalchemy-boolean-search.readthedocs.org/)

## Authors
* Ling Thio - ling.thio [at] gmail.com

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

* [Flask](http://flask.pocoo.org/)
* [SQLAlchemy](http://www.sqlalchemy.org/)
* [pyparsing](https://pyparsing.wikispaces.com/)

## Alternative modules
* [SQLAlchemy-Searchable](https://sqlalchemy-searchable.readthedocs.org/)
  adds full text searching and relies on PostgreSQL vectors and triggers.
* [sqlalchemy-elasticquery](https://github.com/loverajoel/sqlalchemy-elasticquery)



