几乎是postgres hstore解析器。

cpghstore的Python项目详细描述


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)

关于

cpghstore是用c编写的,它是 pghstore。运行python setup.py test -s benchmark查看它的执行情况(如果 您希望显示比较)。

安装

运行pip install cpghstore或下载 从GitHub中获取源并运行python setup.py install

用法

解码和编码hstore字符串:

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

测试

要运行测试套件,请运行python setup.py test

基准

运行python setup.py test -s benchmark查看它的性能(需要 如果要显示比较,请安装pghstore)。

限制

只支持str字符串(即不支持unicode字符串)。 只能解码(加载)字符串值,即在 “key”=>;123不是。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何将图像写入文件–Java ImageIO   spring无法获取连接,数据源无效:“java.sql.SQLException:找不到适合数据源的驱动程序”   java错误,请在hs_err_pidXXX中输入信息。JVM崩溃时的日志文件   java任何人在resteasy中都会遇到不可用的根路径吗   java JPA元模型和实体类   java在jhipster应用程序上找不到symbol:class SparkReporter   java向前看下一个地图条目   java单个泛型参数同时接受两种不同的类型   java无法通过KAFKA api连接到EventHub   Java swing JPanel将数据从Textarea保存到字符串变量   java“downloadmavenplugin”可下载多个文件并重新定位输出目录   java单例类与静态方法和字段?   java多线程Spring事务   没有片段的java滑动菜单   java在swing中,是否可以在paintComponent()中找到JPanel的宽度和高度属性?   使用ProcessBuilder使用交互式IO运行java C程序   javajavax。imageio。IIOException:无法在Tomcat 9、OpenJDK 11和Geoserver中创建ImageInputStream   java对整数使用哈希集