Skip to main content

Python Groonga Client

Project description

About

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

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()

Project details


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.1.1.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file poyonga-0.1.1.tar.gz.

File metadata

  • Download URL: poyonga-0.1.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for poyonga-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ea2ad7bbf88fccddbd480936c4a8900092b81cf49b8770fdd33cf9f8d8967e9f
MD5 9ba11a37a4868ef74173627052e3eb5f
BLAKE2b-256 14b2b5a5e3266c7e06871603453f6e200730ed78b0fcfc8adb08d167d3a01487

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page