JSONStore是一个通过HTTP暴露的轻量级数据库,用于JSON文档。
项目描述
一个无模式的JSON文档数据库,通过REST API暴露,并使用灵活的匹配算法实现搜索。
快速入门
$ pip install jsonstore
$ jsonstore
* Running on http://127.0.0.1:31415/
创建文档
$ curl -v http://127.0.0.1:31415/ -d '{"foo":"bar","baz":{"count":42}}'
< HTTP/1.0 201 Created
< Location: http://127.0.0.1:31415/72dcf1ee-8efd-4d7f-8ca1-2eda2bf85099
< etag: "348f16ee0c0856d853117bde8413a4270d1d3487"
{
"foo": "bar",
"baz": {
"count": 42
},
"__id__": "72dcf1ee-8efd-4d7f-8ca1-2eda2bf85099",
"__updated__": "2012-05-09T20:33:36.928075+00:00"
}
搜索存储
$ curl -g 'http://127.0.0.1:31415/{"baz":{"count":"GreaterThan(40)"}}'
[
{
"foo": "bar",
"baz": {
"count": 42
},
"__id__": "72dcf1ee-8efd-4d7f-8ca1-2eda2bf85099",
"__updated__": "2012-05-09T20:33:36.928075+00:00"
}
]
它还提供了一个Python API。上述代码可以这样实现
>>> from jsonstore.client import EntryManager
>>> from jsonstore.operators import GreaterThan
>>> em = EntryManager('http://127.0.0.1:31415/')
>>> em.create(foo="bar", "baz"={"count": 42})
>>> results = em.search(baz={"count": GreaterThan(40)})
或者这样,仅供娱乐
>>> from jsonstore.dsl import Store
>>> store = Store('http://127.0.0.1:31415/')
>>> { "foo": "bar", "baz": { "count": 42 } } >> store
>>> results = store | { "baz": { "count": GreaterThan(40) } }
请访问网站以获取更多示例http://code.dealmeida.net/jsonstore
项目详情
下载文件
下载您平台所需的文件。如果您不确定选择哪一个,请了解更多关于 安装包的信息。
源代码发行版
jsonstore-1.3.1.tar.gz (13.4 kB 查看哈希值)
构建发行版
jsonstore-1.3.1-py2.7.egg (35.7 kB 查看哈希值)
关闭
jsonstore-1.3.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6899def45ca9c4ac975008060747056cf187783ad2e2ae358994f6c3e9406124 |
|
MD5 | 75312e3431565a834b6075fa088e5afd |
|
BLAKE2b-256 | c135b3c39166e1eef71c8f7c42ed3f58272959bb63fb9223a15043d34d0bc0c9 |
关闭
jsonstore-1.3.1-py2.7.egg 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | da3ca2c07b324fb01ce63ef7e93249eaafc9686a2d800d38e196041bc3285317 |
|
MD5 | c42e95c08e5bb3b2dff62345dc4f59c6 |
|
BLAKE2b-256 | 67d49691cb6260ca52d4eea6b299979d85135e5b4ef5e87f1b6a5ec2dd66935f |