Python Groonga Client
Project description
Python Groonga Client. poyonga support to HTTP and GQTP protocol.
Installation
from pip:
pip install --upgrade poyonga
from easy_install:
easy_install -ZU poyonga
Usage
Setup Groonga Server
$ groonga -n grn.db # create groonga database file $ groonga -s grn.db # start groonga server with GQTP
Basic Usage
>>> from poyonga import Groonga
>>> g = Groonga()
>>> g.protocol
'http'
>>> ret = g.call("status")
>>> ret
<poyonga.result.GroongaResult object at 0x8505ccc>
>>> ret.status
0
>>> ret.body
{u'uptime': 427, u'max_command_version': 2, u'n_queries': 3,
u'cache_hit_rate': 66.6666666666667, u'version': u'1.2.8', u
'alloc_count': 156, u'command_version': 1, u'starttime': 132
8286909, u'default_command_version': 1}
>>>
with eventlet
from poyonga import Groonga
import eventlet
eventlet.monkey_patch()
def fetch(cmd, **kwargs):
g = Groonga()
ret = g.call(cmd, **kwargs)
print ret.status
print ret.body
print "*" * 40
cmds = [("status", {}),
("log_level", {"level": "warning"}),
("table_list", {})
("select", {"table": "Site"})]
pool = eventlet.GreenPool()
for cmd, kwargs in cmds:
pool.spawn_n(fetch, cmd, **kwargs)
pool.waitall()
Custom prefix path
If you use the Custom prefix path and Multi databases , specify prefix_path .
# default is '/d/'
g = Groonga(prefix_path='/db2/')
example code
Links
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
poyonga-0.2.3.tar.gz
(5.0 kB
view details)
File details
Details for the file poyonga-0.2.3.tar.gz
.
File metadata
- Download URL: poyonga-0.2.3.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18295a80868015eecb7c3693673afd7c3566c2133ec75f2f99384d404ffa309a |
|
MD5 | 5a18e427aaddcfaddbfb49854e1bab4d |
|
BLAKE2b-256 | a801b46d32d831766097a578a91948a4e0d8bde88b6280fe0b08565273197f92 |