{ "info": { "author": "Juan Batiz-Benet", "author_email": "juan@benet.ai", "bugtrack_url": null, "classifiers": [ "Topic :: Database", "Topic :: Database :: Front-Ends" ], "description": "# datastore\n\n## simple, unified API for multiple data stores\n\ndatastore is a generic layer of abstraction for data store and database access.\nIt is a **simple** API with the aim to enable application development in a\ndatastore-agnostic way, allowing datastores to be swapped seamlessly without\nchanging application code. Thus, one can leverage different datastores with\ndifferent strengths without committing the application to one datastore\nthroughout its lifetime. It looks like this:\n\n +---------------+\n | application | <--- No cumbersome SQL or Mongo specific queries!\n +---------------+\n | <--- simple datastore API calls\n +---------------+\n | datastore | <--- datastore implementation for underlying db\n +---------------+\n | <--- database specific calls\n +---------------+\n | various dbs | <--- MySQL, Redis, MongoDB, FS, ...\n +---------------+\n\nIn addition, grouped datastores significantly simplify interesting data access\npatterns (such as caching and sharding).\n\n\n## About\n\n### Install\n\nFrom pypi (using pip):\n\n sudo pip install datastore\n\nFrom pypi (using setuptools):\n\n sudo easy_install datastore\n\nFrom source:\n\n git clone https://github.com/datastore/datastore/\n cd datastore\n sudo python setup.py install\n\n### Subprojects\n\n\n* [datastore.aws](https://github.com/datastore/datastore.aws) - aws s3 implementation\n* [datastore.git](https://github.com/datastore/datastore-git) - git implementation\n* [datastore.mongo](https://github.com/datastore/datastore.mongo) - monogdb implementation\n* [datastore.memcached](https://github.com/datastore/datastore.memcached) - memcached implementation\n* [datastore.pylru](https://github.com/datastore/datastore.pylru) - pylru cache implementation\n* [datastore.redis](https://github.com/datastore/datastore.redis) - redis implementation\n\n\n### Documentation\n\nThe documentation can be found at:\nhttp://datastore.readthedocs.org/en/latest/\n\n### License\n\ndatastore is under the MIT License.\n\n### Contact\n\ndatastore is written by [Juan Batiz-Benet](https://github.com/jbenet). It\nwas originally part of [py-dronestore](https://github.com/jbenet/py-dronestore).\nOn December 2011, it was re-written as a standalone project.\n\nProject Homepage:\n[https://github.com/datastore/datastore](https://github.com/datastore/datastore)\n\nFeel free to contact me. But please file issues in github first. Cheers!\n\n## Contributing\n\n### Implementations\n\nPlease write and contribute implementations for other data stores. This project\ncan only be complete with lots of help.\n\n### Style\n\nPlease follow proper pythonic style in your code.\n\nSee [PEP 8](http://www.python.org/dev/peps/pep-0008/) and the [Google Python\nStyle Guide](http://google-styleguide.googlecode.com/svn/trunk/pyguide.html).\n\n### Docs\n\nPlease document all code. ``datastore`` uses ``sphinx`` for documentation. Take\na look at the ``docs/`` directory.\n\nTo make sure the documentation compiles, run:\n\n cd docs\n make html\n open .build/html/index.html\n\nWhich should -- if all goes well -- open your favorite browser on the\nnewly-built docs.\n\n## Examples\n\n### Hello World\n\n >>> import datastore.core\n >>> ds = datastore.DictDatastore()\n >>>\n >>> hello = datastore.Key('hello')\n >>> ds.put(hello, 'world')\n >>> ds.contains(hello)\n True\n >>> ds.get(hello)\n 'world'\n >>> ds.delete(hello)\n >>> ds.get(hello)\n None\n\n#### Hello filesystem\n\n >>> import datastore.filesystem\n >>>\n >>> ds = datastore.filesystem.FileSystemDatastore('/tmp/.test_datastore')\n >>>\n >>> hello = datastore.Key('hello')\n >>> ds.put(hello, 'world')\n >>> ds.contains(hello)\n True\n >>> ds.get(hello)\n 'world'\n >>> ds.delete(hello)\n >>> ds.get(hello)\n None\n\n\n#### Hello Tiered Access\n\n\n >>> import pymongo\n >>> import datastore.core\n >>>\n >>> from datastore.mongo import MongoDatastore\n >>> from datastore.pylru import LRUCacheDatastore\n >>> from datastore.filesystem import FileSystemDatastore\n >>>\n >>> conn = pymongo.Connection()\n >>> mongo = MongoDatastore(conn.test_db)\n >>>\n >>> cache = LRUCacheDatastore(1000)\n >>> fs = FileSystemDatastore('/tmp/.test_db')\n >>>\n >>> ds = datastore.TieredDatastore([cache, mongo, fs])\n >>>\n >>> hello = datastore.Key('hello')\n >>> ds.put(hello, 'world')\n >>> ds.contains(hello)\n True\n >>> ds.get(hello)\n 'world'\n >>> ds.delete(hello)\n >>> ds.get(hello)\n None\n\n\n#### Hello Sharding\n\n >>> import datastore.core\n >>>\n >>> shards = [datastore.DictDatastore() for i in range(0, 10)]\n >>>\n >>> ds = datastore.ShardedDatastore(shards)\n >>>\n >>> hello = datastore.Key('hello')\n >>> ds.put(hello, 'world')\n >>> ds.contains(hello)\n True\n >>> ds.get(hello)\n 'world'\n >>> ds.delete(hello)\n >>> ds.get(hello)\n None\n\n\n## API\n\nThe datastore API places an emphasis on **simplicity** and elegance. Only four\ncore methods must be implemented (get, put, delete, query).\n\n### get(key)\n\nReturn the object named by key or None if it does not exist.\n\n Args:\n key: Key naming the object to retrieve\n\n Returns:\n object or None\n\n### put(key, value)\n\nStores the object `value` named by `key`.\nHow to serialize and store objects is up to the underlying datastore.\nIt is recommended to use simple objects (strings, numbers, lists, dicts).\n\n Args:\n key: Key naming `value`\n value: the object to store.\n\n### delete(key)\n\nRemoves the object named by `key`.\n\n Args:\n key: Key naming the object to remove.\n\n### query(query):\n\nReturns an iterable of objects matching criteria expressed in `query`\nImplementations of query will be the largest differentiating factor\namongst datastores. All datastores **must** implement query, even using\nquery's worst case scenario, see Query class for details.\n\n Args:\n query: Query object describing the objects to return.\n\n Returns:\n iterable cursor with all objects matching criteria\n\n\n### Specialized Features\n\nDatastore implementors are free to implement specialized features, pertinent\nonly to a subset of datastores, with the understanding that these should aim\nfor generality and will most likely not be implemented across other datastores.\n\nWhen implementings such features, please remember the goal of this project:\nsimple, unified API for multiple data stores. When making heavy use of a\nparticular library's specific functionality, perhaps one should not use\ndatastore and should directly use that library.\n\n### Key\n\nA Key represents the unique identifier of an object.\n\nOur Key scheme is inspired by file systems and the Google App Engine key\nmodel.\n\nKeys are meant to be unique across a system. Keys are hierarchical,\nincorporating increasingly specific namespaces. Thus keys can be deemed\n'children' or 'ancestors' of other keys.\n\n Key('/Comedy')\n Key('/Comedy/MontyPython')\n\nAlso, every namespace can be parametrized to embed relevant object\ninformation. For example, the Key `name` (most specific namespace) could\ninclude the object type:\n\n Key('/Comedy/MontyPython/Actor:JohnCleese')\n Key('/Comedy/MontyPython/Sketch:CheeseShop')\n Key('/Comedy/MontyPython/Sketch:CheeseShop/Character:Mousebender')", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/datastore/datastore", "keywords": "datastore,unified api,database", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "datastore", "package_url": "https://pypi.org/project/datastore/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/datastore/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/datastore/datastore" }, "release_url": "https://pypi.org/project/datastore/0.3.6/", "requires_dist": null, "requires_python": null, "summary": "simple, unified API for multiple data stores", "version": "0.3.6" }, "last_serial": 788813, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "ce6588d074fcc177c2791ebbbbad5896", "sha256": "21fa97f75855f26f9c5e94b519296f902bbddb513d81699b5c0582a6b6c4a03d" }, "downloads": -1, "filename": "datastore-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ce6588d074fcc177c2791ebbbbad5896", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25001, "upload_time": "2012-07-14T15:23:31", "url": "https://files.pythonhosted.org/packages/74/63/3d31eaf061a6ddbdc47929a34669d15aa8fd28c7c3f8a0722a39c1a43ff4/datastore-0.2.1.tar.gz" } ], "0.2.10": [ { "comment_text": "", "digests": { "md5": "d171e40a43c62453d9dbba2373bc490e", "sha256": "da8955fc36b5b2f8e425423835df893622b0eacc84425c2ca3b84b0cab92ff37" }, "downloads": -1, "filename": "datastore-0.2.10.tar.gz", "has_sig": false, "md5_digest": "d171e40a43c62453d9dbba2373bc490e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35362, "upload_time": "2012-08-10T13:13:43", "url": "https://files.pythonhosted.org/packages/ee/f7/e70071593861b730e170e2d4247ede79285ddb7a77b994ae06e3fa265da6/datastore-0.2.10.tar.gz" } ], "0.2.11": [ { "comment_text": "", "digests": { "md5": "a66e1358e279238e350a08ee071b30ae", "sha256": "8807ad906d2b71c2ab5684c96c6dd91fa95e33e93271d43a67ca35fe1732aa32" }, "downloads": -1, "filename": "datastore-0.2.11.tar.gz", "has_sig": false, "md5_digest": "a66e1358e279238e350a08ee071b30ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35398, "upload_time": "2012-08-10T13:35:21", "url": "https://files.pythonhosted.org/packages/9a/47/eac83e8b5ab2c34e65435e8839202dcc63fde489a14f7fa2a54625842033/datastore-0.2.11.tar.gz" } ], "0.2.12": [ { "comment_text": "", "digests": { "md5": "d3cdcd2563d025f6b431e558af9de020", "sha256": "d6882e653948a5edb4d3bbf2c136c866945eb470afe19cb93f7e77c0bd089e26" }, "downloads": -1, "filename": "datastore-0.2.12.tar.gz", "has_sig": false, "md5_digest": "d3cdcd2563d025f6b431e558af9de020", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35790, "upload_time": "2013-01-02T20:55:00", "url": "https://files.pythonhosted.org/packages/c3/4f/09ec3923adb1508cd95245fb48df06a111268a45a70d65867aaab40e7c1b/datastore-0.2.12.tar.gz" } ], "0.2.13": [ { "comment_text": "", "digests": { "md5": "fdbd96c037fd6db6f0637cdb62d57d60", "sha256": "4a3cd536c71d67aafd938cd1b1191c45ae56ca07d7770ac9c99ae2367be14a02" }, "downloads": -1, "filename": "datastore-0.2.13.tar.gz", "has_sig": false, "md5_digest": "fdbd96c037fd6db6f0637cdb62d57d60", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36563, "upload_time": "2013-01-05T15:21:27", "url": "https://files.pythonhosted.org/packages/47/91/12bf829154e404a64f49fe2555e731a3686e676dbbb002bea30e0aea3a77/datastore-0.2.13.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "8938c68a9fe779077b9cf1eed5f7b435", "sha256": "c491ce10f61dfc955d1d7a8a4080161608b1322f3811eaefb35c5150dc3acf70" }, "downloads": -1, "filename": "datastore-0.2.2.tar.gz", "has_sig": false, "md5_digest": "8938c68a9fe779077b9cf1eed5f7b435", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25135, "upload_time": "2012-07-14T16:30:22", "url": "https://files.pythonhosted.org/packages/6a/81/7c645f402f7a605a1c6b0db90ad9b0599284c4b80f30b18cd2ceae09077e/datastore-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "080f1d12795fef7531133ddf1c7a53f6", "sha256": "a25012cd309c86e75cf48a027977390938d6cb09f0e78a48042470b6af9b0b04" }, "downloads": -1, "filename": "datastore-0.2.3.tar.gz", "has_sig": false, "md5_digest": "080f1d12795fef7531133ddf1c7a53f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25753, "upload_time": "2012-07-15T15:02:00", "url": "https://files.pythonhosted.org/packages/50/b2/1a92bd031727ca4541885f89b033a4bcfa7f56bb3c5cf7da130f1005db42/datastore-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "46f3eefe71d028f30e03e2dbf1a4be48", "sha256": "87c4b7e79b8cdbcee2b5291faa58dbaf80f65f8dc8829cd0a517188928c470ef" }, "downloads": -1, "filename": "datastore-0.2.4.tar.gz", "has_sig": false, "md5_digest": "46f3eefe71d028f30e03e2dbf1a4be48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26852, "upload_time": "2012-07-15T19:05:58", "url": "https://files.pythonhosted.org/packages/0d/93/8dc6e0498099ebc8714b70c00e28916500c3189a96ef5719757c006cca90/datastore-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "c9e7858896bcdb50cf2fec8c7b54d4a6", "sha256": "669b4dcbd1e10f100e47c17382e7c9e2734d36a13105cfdd8d5a558f04d55695" }, "downloads": -1, "filename": "datastore-0.2.5.tar.gz", "has_sig": false, "md5_digest": "c9e7858896bcdb50cf2fec8c7b54d4a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28079, "upload_time": "2012-07-28T08:01:35", "url": "https://files.pythonhosted.org/packages/28/c6/727a5c0c2d6d7bbc43dd71ce93dbde4cfc2fe105a8807c62fb8b930652c2/datastore-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "d9eb364d75520ac3e89d93867ebdafbb", "sha256": "c0a810ba5d77083454e1018374030d12ae22be1e7d881e8e112eea244e1848a9" }, "downloads": -1, "filename": "datastore-0.2.6.tar.gz", "has_sig": false, "md5_digest": "d9eb364d75520ac3e89d93867ebdafbb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28937, "upload_time": "2012-07-29T11:42:23", "url": "https://files.pythonhosted.org/packages/e6/25/88153af445ae20663632414d79a36880b63306601b66f762ab33898d8f11/datastore-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "29da4d892b1f3dfb0ce8ea265b1c3a74", "sha256": "09655cebf7b73f33e8ad85e1d06e3a2419eb219feb919a8452d0d15a62673c75" }, "downloads": -1, "filename": "datastore-0.2.7.tar.gz", "has_sig": false, "md5_digest": "29da4d892b1f3dfb0ce8ea265b1c3a74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30995, "upload_time": "2012-08-03T12:03:00", "url": "https://files.pythonhosted.org/packages/76/3b/4ddde5633f204168ef837c720613bbcbb7e4dfc060b2d31ad0da26eb5c8e/datastore-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "6670ad6ef6829118addf68235574c33f", "sha256": "ef6fd9dbf52ab9bd7720a45be7104c20f8f738c65e9d7e902f8612b9aac1d6ac" }, "downloads": -1, "filename": "datastore-0.2.8.tar.gz", "has_sig": false, "md5_digest": "6670ad6ef6829118addf68235574c33f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30974, "upload_time": "2012-08-03T12:10:05", "url": "https://files.pythonhosted.org/packages/27/f5/deb75b49b143349e639db89e15e0426451bc6a3c2d11efa01271076d1022/datastore-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "39b12e642ac86484355bb4c9596f1916", "sha256": "8a87dc8b72c7a2a900f9a9a542a174b7d25f5df4e7da09d41c21436981c3b4fe" }, "downloads": -1, "filename": "datastore-0.2.9.tar.gz", "has_sig": false, "md5_digest": "39b12e642ac86484355bb4c9596f1916", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32607, "upload_time": "2012-08-10T13:11:22", "url": "https://files.pythonhosted.org/packages/58/05/f191948947c3dbc48f195e0c3cf522097908611e6f05f157d80a923a46e0/datastore-0.2.9.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "7cff9b58f1263196925b6bd5de5e8025", "sha256": "3ebef0953fd248d47523c258bb7443e14bcfcf373742c21b172487d478486b59" }, "downloads": -1, "filename": "datastore-0.3.0.tar.gz", "has_sig": false, "md5_digest": "7cff9b58f1263196925b6bd5de5e8025", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29031, "upload_time": "2013-02-13T18:03:15", "url": "https://files.pythonhosted.org/packages/4a/bb/68ff003b4724dfea5915efd348624a8993a31c29064e533c974fb47dff13/datastore-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "4a41efb734683c927da2916b4865a954", "sha256": "1a6cf529732032ec9f7723cc9ae07ff7aacbf34d11bdb51f82adbad7f4f069f1" }, "downloads": -1, "filename": "datastore-0.3.1.tar.gz", "has_sig": false, "md5_digest": "4a41efb734683c927da2916b4865a954", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29106, "upload_time": "2013-02-13T18:28:53", "url": "https://files.pythonhosted.org/packages/c4/4c/c9c7566f4884f70ae4a8948eac993cdcd3cb257c811983262bc3816046f4/datastore-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "93dd76947bbd2534040a4186263da266", "sha256": "13a9188641fff299a522fd8ea652b1503f910eb0850773106ff7cc91697d8541" }, "downloads": -1, "filename": "datastore-0.3.2.tar.gz", "has_sig": false, "md5_digest": "93dd76947bbd2534040a4186263da266", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29177, "upload_time": "2013-02-14T13:29:44", "url": "https://files.pythonhosted.org/packages/e1/f5/9bbf5bc05dd4d4d38b6b9bfd59c8480d9a71ba57abf6be209e5118037f6e/datastore-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "8783f2a4a3e55f5478bb9b13ecc934fd", "sha256": "23710fa5d5b7a852ceabe0e561f107036bd09bb8a1a965dd463c19979b069a7b" }, "downloads": -1, "filename": "datastore-0.3.3.tar.gz", "has_sig": false, "md5_digest": "8783f2a4a3e55f5478bb9b13ecc934fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29139, "upload_time": "2013-02-14T13:43:24", "url": "https://files.pythonhosted.org/packages/ee/49/5d5edb53d11d6284f4213d9ed9061110e3ed96c2e7f0f8708ffa49350109/datastore-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "5ab54fe49c352bebcc8e5229ed1a9a17", "sha256": "681e82e8d1a17907f9588ef3db5e0b32f2935245ff321a8acc09892e964a3ee2" }, "downloads": -1, "filename": "datastore-0.3.4.tar.gz", "has_sig": false, "md5_digest": "5ab54fe49c352bebcc8e5229ed1a9a17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29523, "upload_time": "2013-02-15T12:20:40", "url": "https://files.pythonhosted.org/packages/53/0e/b5ab6b9106dbc6c15d7cee5423eb53026a8f97a808b130febf23128a0763/datastore-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "cad6396247f4deada943f29385aa7f0d", "sha256": "df1dad7a8a3b3c227dc8e116ccd087ea856e6af3b01b755346d601791b3c6dd6" }, "downloads": -1, "filename": "datastore-0.3.5.tar.gz", "has_sig": false, "md5_digest": "cad6396247f4deada943f29385aa7f0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30139, "upload_time": "2013-06-27T11:02:49", "url": "https://files.pythonhosted.org/packages/c1/19/4940b11ae5ab86b4d0b4dab83c4ae91307d621a4bc2dc990a153d88f5b21/datastore-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "52e20f7abc06cd53a63a56a063bad11b", "sha256": "a4f36e3f7fd065e631a11f0af32bade5faf56a168de99cca5e4fb29e5617796c" }, "downloads": -1, "filename": "datastore-0.3.6.tar.gz", "has_sig": false, "md5_digest": "52e20f7abc06cd53a63a56a063bad11b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30041, "upload_time": "2013-06-27T13:51:22", "url": "https://files.pythonhosted.org/packages/ef/7b/ce2e6c990878c77fe463f2b0552937b3e91b699b98214e6ccd8b8eb613c1/datastore-0.3.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "52e20f7abc06cd53a63a56a063bad11b", "sha256": "a4f36e3f7fd065e631a11f0af32bade5faf56a168de99cca5e4fb29e5617796c" }, "downloads": -1, "filename": "datastore-0.3.6.tar.gz", "has_sig": false, "md5_digest": "52e20f7abc06cd53a63a56a063bad11b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30041, "upload_time": "2013-06-27T13:51:22", "url": "https://files.pythonhosted.org/packages/ef/7b/ce2e6c990878c77fe463f2b0552937b3e91b699b98214e6ccd8b8eb613c1/datastore-0.3.6.tar.gz" } ] }