{ "info": { "author": "Thomas Sileo", "author_email": "t@a4.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# BlobStash Python Client\n\n[![Travis](https://img.shields.io/travis/tsileo/blobstash-python-docstore.svg?maxAge=2592000)](https://travis-ci.org/tsileo/blobstash-python)\n    [![PyPI](https://img.shields.io/pypi/v/blobstash-docstore.svg)](https://pypi.python.org/pypi/blobstash)\n    [![PyPI](https://img.shields.io/pypi/pyversions/blobstash-docstore.svg)](https://pypi.python.org/pypi/blobstash)\n    [![Docs](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://blobstash-python-docstore.a4.io/)\n   [![License](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/tsileo/blobstash-python/master/LICENSE)\n\nClient for [BlobStash](https://github.com/tsileo/blobstash) JSON document store.\n\nSee the [documentation](https://blobstash-python-docstore.a4.io/) for more details.\n\n## Examples\n\n```python\n>>> from blobstash.docstore import DocStoreClient, Path, Q\n>>> client = DocStoreClient(api_key='123')\n>>> col = client.my_collection\n>>> col\n\n>>> # Insert data\n>>> k = col.insert({'key': 10, 'k1': True, 'k2': None, 'l': [1, 2, 'c']})\n>>> k\n\n>>> # Get a single document\n>>> col.get_by_id(k)\n{'_id': ,\n 'k1': True,\n 'k2': None,\n 'key': 10,\n 'l': [1, 2, 'c']}\n>>> col.get_by_id('14d854f6e9ee37a9cd8c1ffc')\n{'_id': ,\n 'k1': True,\n 'k2': None,\n 'key': 10,\n 'l': [1, 2, 'c']}\n# Native Python query using Q\n>>> for doc in col.query(Q['key'] == 10):\n... print(doc)\n{'k1': True, 'k2': None, 'key': 10, 'l': [1, 2, 'c'], '_id': }\n>>> for doc in col.query(Q['key'] > 10):\n... print(doc)\n\n>>> for doc in col.query():\n... print(doc)\n{'k1': True, 'k2': None, 'key': 10, 'l': [1, 2, 'c'], '_id': }\n>>> for doc in col.query(Q['l'].contains(1)):\n... print(doc)\n{'k1': True, 'k2': None, 'key': 10, 'l': [1, 2, 'c'], '_id': }\n>>> for doc in col.query(Q['l'][0] == 1):\n... print(doc)\n{'k1': True, 'k2': None, 'key': 10, 'l': [1, 2, 'c'], '_id': }\n>>> # Raw Lua query\n>>> # 1. in shortcut mode\n>>> for doc in col.query(\"doc.k1 == true and doc.key ~= nil\"):\n... print(doc)\n{'k1': True, 'k2': None, 'key': 10, 'l': [1, 2, 'c'], '_id': }\n>>> # 2. full Lua script\n>>> from blobstash.docstore.query import LuaScript\n>>> script = LuaScript(\"\"\"\n... return function(doc)\n... if doc.key == 10 then\n... return true\n... end\n... return false\n... end\n... \"\"\")\n>>> for doc in col.query(script):\n... print(doc)\n{'k1': True, 'k2': None, 'key': 10, 'l': [1, 2, 'c'], '_id': }\n```\n\n## LICENSE\n\nMIT", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tsileo/blobstash-python", "keywords": "blobstash DocStore client JSON Lua document store", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "blobstash", "package_url": "https://pypi.org/project/blobstash/", "platform": "", "project_url": "https://pypi.org/project/blobstash/", "project_urls": { "Homepage": "https://github.com/tsileo/blobstash-python" }, "release_url": "https://pypi.org/project/blobstash/0.1.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "BlobStash client", "version": "0.1.0" }, "last_serial": 4153988, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e25ca507c303a9bb4272125f0db5d910", "sha256": "2edb58e274cba51a2278e72794e20c4288962e786f47ab55743129707886d891" }, "downloads": -1, "filename": "blobstash-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e25ca507c303a9bb4272125f0db5d910", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13032, "upload_time": "2018-08-09T18:53:28", "url": "https://files.pythonhosted.org/packages/88/04/94146a666d3de8b410606090bc33f005f17467095868b7e52c93862acc2d/blobstash-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e25ca507c303a9bb4272125f0db5d910", "sha256": "2edb58e274cba51a2278e72794e20c4288962e786f47ab55743129707886d891" }, "downloads": -1, "filename": "blobstash-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e25ca507c303a9bb4272125f0db5d910", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13032, "upload_time": "2018-08-09T18:53:28", "url": "https://files.pythonhosted.org/packages/88/04/94146a666d3de8b410606090bc33f005f17467095868b7e52c93862acc2d/blobstash-0.1.0.tar.gz" } ] }