{ "info": { "author": "Micha\u0142 Jaworski", "author_email": "swistakm@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP :: Indexing/Search" ], "description": "|Build Status| |Coverage Status| |Documentation Status|\n\nsolrq\n=====\n\n``solrq`` is a Python Solr query utility. It helps making query strings\nfor Solr and also helps with escaping reserved characters. ``solrq`` is\nhas no external dependencies and is compatibile with ``python2.6``,\n``python2.7``, ``python3.3``, ``python3.4``, ``python3.5``, ``pypy`` and\n``pypy3``. It might be compatibile with other python\nreleases/implentations but this has not been tested yet or is no longer\ntested (e.g ``python3.2``).\n\n::\n\n pip install solrq\n\nAnd you're ready to go!\n\nusage\n=====\n\nEverything in ``solrq`` is about ``Q()`` object. Drop into python repl\nand just feed it with bunch of field and search terms to see how it\nworks:\n\n.. code:: python\n\n >>> from solrq import Q\n >>> # note: all terms in single Q object are implicitely joined with 'AND'\n >>> query = Q(type=\"animal\", species=\"dog\")\n >>> query\n \n\n >>> # ohh, forgot about cats?\n >>> query | Q(type=\"animal\", species=\"cat\")\n \n\n >>># more a cat lover? Let's give them a boost boost\n >>> Q(type=\"animal\") & (Q(species=\"cat\")^2 | Q(species=\"dog\"))\n \n\nBut what to do with this ``Q``? Simply pass it to your Solr library of\nchoice, like `pysolr `__ or\n`mysolr `__. Most of python Solr\nlibraries expect simple string as a query parameter and do not bother\nwith escaping of reserved characters so you must take care of that by\nyourself. This is why ``solrq`` integrates so easily. Here is an example\nhow you can use it with\n`pysolr `__:\n\n.. code:: python\n\n from solrq import Q\n import pysolr\n\n solr = Solr(\"\")\n\n # simply using Q object\n solr.search(Q(text=\"easy as f***\"))\n\n # or explicitely making it string\n solr.search(str(Q(text=\"easy as f***\")))\n\nquick reference\n---------------\n\nFull reference can be found in `API reference documentation\npage `__ but\nhere is a short reference.\n\nboosting queries\n~~~~~~~~~~~~~~~~\n\nUse python ``^`` operator:\n\n.. code:: python\n\n >>> Q(text='cat') ^ 2\n \n\nAND queries\n~~~~~~~~~~~\n\nUse python ``&`` operator:\n\n.. code:: python\n\n >>> Q(text='cat') & Q(text='dog')\n \n\nOR queries\n~~~~~~~~~~\n\nUse python ``|`` operator:\n\n.. code:: python\n\n >>> Q(text='cat') | Q(text='dog')\n \n\nNOT queries\n~~~~~~~~~~~\n\nUse python ``~`` operator:\n\n.. code:: python\n\n >>> ~ Q(text='cat')\n \n\nranges\n~~~~~~\n\nUse ``solrq.Range`` wrapper:\n\n.. code:: python\n\n >>> from solrq import Range\n >>> Q(age=Range(18, 25))\n \n\nproximity searches\n~~~~~~~~~~~~~~~~~~\n\nUse ``solrq.Proximity`` wrapper:\n\n.. code:: python\n\n >>> from solrq import Proximity\n >>> Q(age=Proximity(\"cat dogs\", 5))\n \n\nsafe strings\n~~~~~~~~~~~~\n\nAll raw string values are treated as unsafe by default and will be\nescaped to ensure that final query string will not be broken by some\nrougue search value. This of course can be disabled if you know what\nyou're doing using ``Value`` wrapper:\n\n.. code:: python\n\n >>> from solrq import Q, Value\n >>> Q(type='foo bar[]')\n \n >>> Q(type=Value('foo bar[]', safe=True))\n \n\ntimedeltas, datetimes\n~~~~~~~~~~~~~~~~~~~~~\n\nSimply as:\n\n.. code:: python\n\n >>> from datetime import datetime, timedelta\n >>> Q(date=datetime(1970, 1, 1))\n \n >>> # note that timedeltas has any sense mostly with ranges\n >>> Q(delta=timedelta(days=1))\n \n\nfield wildcard\n~~~~~~~~~~~~~~\n\nIf you need to use wildcards in field names just use dict and unpack it\ninside of ``Q()`` instead of using keyword arguments:\n\n.. code:: python\n\n >>> Q(**{\"*_t\": \"text_to_search\"})\n \n\ncontributing\n============\n\nAny contribution is welcome. Issues, suggestions, pull requests -\nwhatever. There are no strict contribution guidelines beyond PEP-8 and\nsanity. Code style is checked with flakes8 and any PR that has failed\nbuild will not be merged.\n\nOne thing: if you submit a PR please do not rebase it later unless you\nare asked for that explicitely. Reviewing pull requests that suddenly\nhad their history rewritten just drives me crazy.\n\ntesting\n=======\n\nTests are run using tox. Simply install it and run:\n\n::\n\n pip install tox\n tox\n\nAnd that's all.\n\n.. |Build Status| image:: https://travis-ci.org/swistakm/solrq.svg?branch=master\n :target: https://travis-ci.org/swistakm/solrq\n.. |Coverage Status| image:: https://coveralls.io/repos/swistakm/solrq/badge.svg\n :target: https://coveralls.io/r/swistakm/solrq\n.. |Documentation Status| image:: https://readthedocs.org/projects/solrq/badge/?version=latest\n :target: https://readthedocs.org/projects/solrq/?badge=latest", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/swistakm/solrq", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "solrq", "package_url": "https://pypi.org/project/solrq/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/solrq/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/swistakm/solrq" }, "release_url": "https://pypi.org/project/solrq/1.1.1/", "requires_dist": null, "requires_python": null, "summary": "Python Solr query utility", "version": "1.1.1" }, "last_serial": 2683998, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "bf1e2bae112929fa00124ad5fe164408", "sha256": "876d6e70fce2ff62e4108559557f4c07bbdc02284270d6c7099bd0531c70a07c" }, "downloads": -1, "filename": "solrq-0.0.2.tar.gz", "has_sig": false, "md5_digest": "bf1e2bae112929fa00124ad5fe164408", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8409, "upload_time": "2015-06-12T17:14:07", "url": "https://files.pythonhosted.org/packages/2a/a9/8ef7733e5fe865492e6ac85b68b94c42a2e2384ec1c4d0ffc3948896e3f3/solrq-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2ef2c474e735fdec6fd68dbe2f4fd8e7", "sha256": "a9b84d6c146c79457ebf627926c4cee27fedfc8637c09df4ce1226a622195694" }, "downloads": -1, "filename": "solrq-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2ef2c474e735fdec6fd68dbe2f4fd8e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9739, "upload_time": "2015-06-15T13:57:32", "url": "https://files.pythonhosted.org/packages/1a/2f/5a0d0680da0fb4462c88d04c0f22c4182dbe26d35de1b0595e269e3e5711/solrq-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "7ff0f07a7213c9eef0d1dabd3fe596e2", "sha256": "43e96f79ab7544cd18558ba5dc6066683c07f959e2840bd0b7f35de60a5f082d" }, "downloads": -1, "filename": "solrq-0.0.4.tar.gz", "has_sig": false, "md5_digest": "7ff0f07a7213c9eef0d1dabd3fe596e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10125, "upload_time": "2015-06-25T15:36:34", "url": "https://files.pythonhosted.org/packages/f1/e6/b32afb85b0b0e623f85361e526f6ff0ddc496c2838b67090e4aab9764852/solrq-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "f10d4e09a468430e3a22606055fb02f8", "sha256": "2baec094a0d0bfa5f3047d95f9e083aafabc4c5d803e7a14e6aa0bb86b7d3b9a" }, "downloads": -1, "filename": "solrq-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f10d4e09a468430e3a22606055fb02f8", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10771, "upload_time": "2016-08-29T14:18:45", "url": "https://files.pythonhosted.org/packages/8e/c1/1671e9e2a229cb2305578e9c32ee4db7736685cb15051480adf4a1e606c8/solrq-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f8a7ae7e936c6d98aff786903baa7de5", "sha256": "bc6f33c89d5aa5cf56e24dc1d16257e4cd0fbd87893035315a2580761438e2e3" }, "downloads": -1, "filename": "solrq-0.0.5.tar.gz", "has_sig": false, "md5_digest": "f8a7ae7e936c6d98aff786903baa7de5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10158, "upload_time": "2016-08-29T14:17:43", "url": "https://files.pythonhosted.org/packages/8e/5b/2885a638d100ee91f593758c662cb6b142593ebc5e0ab8aa76aefc1d214d/solrq-0.0.5.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "26ed1e2d11960a3a2d7048a3d5f6e6d0", "sha256": "6f1bdf286d78238da38c604a8ace9b07beac31b8e95b8be86066876a605835ba" }, "downloads": -1, "filename": "solrq-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "26ed1e2d11960a3a2d7048a3d5f6e6d0", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10813, "upload_time": "2016-08-29T14:42:51", "url": "https://files.pythonhosted.org/packages/e1/1d/a85c50f78e605d861c68a5b92d417e99dff49e5f191995d28d774c0c5c88/solrq-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e4597652f5946a965adf35192a9cd8a", "sha256": "3ce6a545f57d5d025ef0783558e50b2a537fc02fce322a4c871cd4c6cac52eed" }, "downloads": -1, "filename": "solrq-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1e4597652f5946a965adf35192a9cd8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10318, "upload_time": "2016-08-29T14:42:48", "url": "https://files.pythonhosted.org/packages/d3/97/ae7e1f72a566d0a783d2b5fcfd136cc0db34043fe1facc26f950085a03af/solrq-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "6f6e3317ba0aa9b562c731a2f71cf4b6", "sha256": "3d3111aae5eecda260ca43ab711115cea4af67bffaadaabff0e30d02818cf7f2" }, "downloads": -1, "filename": "solrq-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6f6e3317ba0aa9b562c731a2f71cf4b6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11342, "upload_time": "2016-09-07T10:10:43", "url": "https://files.pythonhosted.org/packages/4d/8d/df45855ad826cc13e6185f79c62008e7de48f6387d5600cbf1be713b77a9/solrq-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e1f0bd74e754c3602664f495a72cab46", "sha256": "e751a49c12e27a7e662fda207365dff85b4f4c993dc0c34461c2e53ba11814d1" }, "downloads": -1, "filename": "solrq-1.1.0.tar.gz", "has_sig": false, "md5_digest": "e1f0bd74e754c3602664f495a72cab46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10872, "upload_time": "2016-09-07T10:10:49", "url": "https://files.pythonhosted.org/packages/03/d6/d5a2bd16d6470eb2cb6822ae854888344dfdc1b1f5a4d39f6bdd2fec4d67/solrq-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "d7fae3cf28baf3db694427a12f3eb927", "sha256": "eec72c6025b829a4004876a52a0e42cd8d6e2046860ff8cd65130d9361d37dda" }, "downloads": -1, "filename": "solrq-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d7fae3cf28baf3db694427a12f3eb927", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11339, "upload_time": "2017-03-05T15:49:06", "url": "https://files.pythonhosted.org/packages/91/05/2ab6e14fc24fab4aa67fcaa2ecc878323028918a925f55a8f4b61dafa113/solrq-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf34f67003265ae746e1948bd5abb5d2", "sha256": "1fd1fa77fbfb09d7a0a4752bc23c53acf734fc4a52b0718eb19171319e64bc30" }, "downloads": -1, "filename": "solrq-1.1.1.tar.gz", "has_sig": false, "md5_digest": "cf34f67003265ae746e1948bd5abb5d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10881, "upload_time": "2017-03-05T15:49:04", "url": "https://files.pythonhosted.org/packages/c5/51/1055c735f59446f028457aeb27432e4765a8f0bcc4ff059f1e01bb011c03/solrq-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d7fae3cf28baf3db694427a12f3eb927", "sha256": "eec72c6025b829a4004876a52a0e42cd8d6e2046860ff8cd65130d9361d37dda" }, "downloads": -1, "filename": "solrq-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d7fae3cf28baf3db694427a12f3eb927", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11339, "upload_time": "2017-03-05T15:49:06", "url": "https://files.pythonhosted.org/packages/91/05/2ab6e14fc24fab4aa67fcaa2ecc878323028918a925f55a8f4b61dafa113/solrq-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf34f67003265ae746e1948bd5abb5d2", "sha256": "1fd1fa77fbfb09d7a0a4752bc23c53acf734fc4a52b0718eb19171319e64bc30" }, "downloads": -1, "filename": "solrq-1.1.1.tar.gz", "has_sig": false, "md5_digest": "cf34f67003265ae746e1948bd5abb5d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10881, "upload_time": "2017-03-05T15:49:04", "url": "https://files.pythonhosted.org/packages/c5/51/1055c735f59446f028457aeb27432e4765a8f0bcc4ff059f1e01bb011c03/solrq-1.1.1.tar.gz" } ] }