You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2014/12/03 05:46:54 UTC

[Solr Wiki] Update of "SolPython" by AlexandreRafalovitch

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "SolPython" page has been changed by AlexandreRafalovitch:
https://wiki.apache.org/solr/SolPython?action=diff&rev1=20&rev2=21

Comment:
Updated Python clients list

+ = Python Solr clients =
+ This is a part of the [[IntegratingSolr|Solr Clients list]]. As with the main list, the latest source update is listed - where possibly - as a proxy for level of relevance. 
+ 
  <<TableOfContents>>
  
- == Python API ==
- There is a simple client API as part of the Solr repository: http://svn.apache.org/viewvc/lucene/solr/tags/release-1.2.0/client/python/
  
- Note: As of version 1.3, Solr no longer comes bundled with a Python client.  The existing client was not sufficiently maintained or tested as development of Solr progressed, and committers felt that the code was not up to our usual high standards of release.
+ == solrcloudpy ==
+ [[https://pypi.python.org/pypi/solrcloudpy/|solrcloudpy]] is a library designed specifically for interacting with SolrCloud. It also comes with an interactive console.
+ 
+ Last update: October 2014
  
  == solrpy ==
+ [[http://pypi.python.org/pypi/solrpy/|solrpy]] is available at The Python Package Index so you should be able to:
  
- [[http://pypi.python.org/pypi/solrpy/|solrpy]] is available at The Python Package Index so you should be able to:
  {{{
  easy_install solrpy
  }}}
  Or you can check out the source code and:
+ 
  {{{
  python setup.py install
  }}}
  
- == PySolr ==
+ Last update: December 2013
  
- There is a independent "pysolr" project available ...
- http://pypi.python.org/pypi/pysolr/
+ == pysolr ==
+ [[http://pypi.python.org/pypi/pysolr/|pysolr]] - lightweight python wrapper for Solr. 
  
+ Last update: December 2013
+ 
- And [[http://bitbucket.org/cogtree/python-solr/overview/|Python Solr]], And enhanced version of pysolr that supports pagination and batch operations.
+ [[http://bitbucket.org/cogtree/python-solr/overview/|Python Solr]], Supposedly an enhanced version of pysolr that supports pagination and batch operations. However, the last update was in April 2012.
  
  == insol ==
+ [[http://github.com/mdomans/insol|insolr]] is another independent Solr API, focused on easy of use in large scale production enviroments, clean and fast, still in development
  
+ Last update: December 2013
- Another independent Solr API, focused on easy of use in large scale production enviroments, clean and fast, still in development
- 
- http://github.com/mdomans/insol
  
  == sunburnt ==
+ [[http://pypi.python.org/pypi/sunburnt|Sunburnt]] is a Solr library, both for inserting and querying documents. Its development has aimed particularly at making the Solr API accessible in a Pythonic style. 
  
- Sunburnt is an actively-developed Solr library, both for inserting and querying documents. Its development has aimed particularly at making the Solr API accessible in a Pythonic style. Sunburnt is in active use on several internet-scale sites.
+ Last update: February 2014 (has lots of forks though by other groups)
  
- http://pypi.python.org/pypi/sunburnt
- 
- http://github.com/tow/sunburnt
+ == Others ==
+  * [[https://github.com/lugensa/scorched|Scorched]] - a fork of sunburnt - June 2014
+  * [[https://github.com/izacus/pysolarized|PySolarized]] ([[https://www.virag.si/2014/04/project-spotlight-pysolarized/|Docs]]) - May 2014
+  * [[https://github.com/anti-social/solar|Solar]] ([[http://solar.readthedocs.org/en/latest/|Russian docs]]) - July 2014
+  * [[https://github.com/zeraholladay/pysolr4/|Pysolr4]] - June 2013
+  * [[http://mysolr.redtuna.org/en/latest/|mysolr]] - Last updated sometime in 2012
+  * [[https://github.com/moliware/solr_cli|Solr command line client]] - October 2012
+  * [[https://launchpad.net/txsolr|txSolr]] is a Twisted-based asynchronous library - October 2011
+  * [[https://github.com/sophilabs/django-solr|Django-Solr]] ORM - August 2012
  
  == Using Solr's Python output ==
  Solr has an optional Python response format that extends its [[SolJSON|JSON output]] in the following ways to allow the response to be safely eval'd by Python's interpreter:
+ 
   * true and false changed to True and False
   * Python unicode strings used where needed
   * ASCII output (with unicode escapes) for less error-prone interoperability
@@ -60, +74 @@

  for doc in rsp['response']['docs']:
    print 'name field =', doc['name']
  }}}
+ With Python 2.6 you can use the literal_eval function instead of eval.  This only evaluates "safe" syntax for the built-in data types and not any executable code:
  
- With Python 2.6 you can use the literal_eval function instead of eval.  This only evaluates "safe" syntax for the built-in data types and not any executable code:
  {{{
  import ast
  rsp = ast.literal_eval(conn.read())
  }}}
- 
  == Using normal JSON ==
- 
  Using {{{eval}}} is generally considered bad form and dangerous in Python.  In theory if you trust the remote server it is okay, but if something goes wrong it means someone can run arbitrary code on your server (attacking eval is very easy).
  
  It would be better to use a Python JSON library like [[http://undefined.org/python/#simplejson|simplejson]].  It would look like:
@@ -80, +92 @@

  rsp = simplejson.load(conn)
  ...
  }}}
+ Safer, and as you can see, easy.
  
- Safer, and as you can see, easy.
- ----
- CategoryQueryResponseWriter
-