This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Connexions project search query parsing library.

Project Description

The Connections project query grammar parsing library.

Install

Use setup.py to install cnx-query-grammar:

$ python setup.py install

This creates a script called query_parser.

Usage

>>> from cnxquerygrammar.query_parser import grammar, DictFormater

>>> node_tree = grammar.parse('Some text')
>>> DictFormater().visit(node_tree)
[('text', 'Some'), ('text', 'text')]

>>> node_tree = grammar.parse('"A phrase"')
>>> DictFormater().visit(node_tree)
[('text', 'A phrase')]

>>> node_tree = grammar.parse('author:"John Smith" type:book')
>>> DictFormater().visit(node_tree)
[('author', 'John Smith'), ('type', 'book')]

>>> node_tree = grammar.parse('author:"John Smith" type:book title:" A Title   With Spaces"')
>>> DictFormater().visit(node_tree)
[('author', 'John Smith'), ('type', 'book'), ('title', 'A Title With Spaces')]

Test

To run the tests:

$ python -m unittest discover

License

This software is subject to the provisions of the GNU Affero General Public License Version 3.0 (AGPL). See license.txt for details. Copyright (c) 2013 Rice University

Release History

Release History

This version
History Node

0.2.2

History Node

0.2.1

History Node

0.2

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cnx-query-grammar-0.2.2.tar.bz2 (4.1 kB) Copy SHA256 Checksum SHA256 Source Sep 6, 2016
cnx-query-grammar-0.2.2.tar.gz (4.1 kB) Copy SHA256 Checksum SHA256 Source Sep 6, 2016
cnx-query-grammar-0.2.2.zip (7.7 kB) Copy SHA256 Checksum SHA256 Source Sep 6, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting