Skip to main content

Fast postgres hstore parser.

Project description

Info:cpghstore is a fast decoder/encoder of the PostgreSQL hstore data type (http://www.postgresql.org/docs/9.0/static/hstore.html).
Author: Robert Kajic (http://github.com/kajic)

About

cpghstore is written in C and is meant to be a faster alternative to pghstore. Run python setup.py test -s benchmark to see how it performs (requires pghstore to be installed if you want comparisons to be shown).

Installation

Run pip install cpghstore or download the source from GitHub and run python setup.py install.

Usage

Decode and encode hstore string:

>>> import cpghstore
>>> # decode
>>> d = cpghstore.loads('"name"=>"Norge/Noreg"')
>>> d
{'name': 'Norge/Noreg'}
>>> # encode
>>> s = cpghstore.dumps(d)
>>> s
'"name"=>"Norge/Noreg"'

Tests

To run the test suite, run python setup.py test.

Benchmark

Run python setup.py test -s benchmark to see how it performs (requires pghstore to be installed if you want comparisons to be shown).

Limitations

Supports only str strings (i.e. not unicode strings). Can only decode (loads) string values, i.e. “key”=>”123” is supported while “key”=>123 is not.

Project details


Release history Release notifications

This version

0.1

Download files

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

Files for cpghstore, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size cpghstore-0.1-py2.7-macosx-10.4-x86_64.egg (5.2 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size cpghstore-0.1.tar.gz (11.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page