{ "info": { "author": "Austin Voecks", "author_email": "austin.voecks@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 3" ], "description": "=========\nApocrypha\n=========\n\n.. image:: https://img.shields.io/pypi/v/apocrypha.svg\n :target: https://pypi.python.org/pypi/apocrypha\n :alt: PyPI Version\n\n.. image:: https://img.shields.io/pypi/pyversions/apocrypha.svg\n :target: https://pypi.python.org/pypi/apocrypha\n :alt: Supported Python Versions\n\n.. image:: https://travis-ci.org/Gandalf-/apocrypha.svg?branch=master\n :target: https://travis-ci.org/Gandalf-/apocrypha\n\n.. image:: https://codecov.io/gh/Gandalf-/apocrypha/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/Gandalf-/apocrypha\n\nApocrypha is a lightweight, flexible JSON server and client written in Python\n3. It includes a client library for easy interaction through Python, and it's\nsimple query format allows APIs to easily written in other languages.\n\nYou can install Apocrypha with pip: ``pip3 install apocrypha``\n\nThen you're ready to start the server: ``python3 -m apocrypha.server``\n\nFeatures\n========\n\n- **multithreaded** Thread safe server and client. All queries are atomic.\n\n- **caching** Writes clear the cache, any query will be served out of the\n cache if possible.\n\n- **nosql** No schemas, no overhead, just your data in the format you\n provided.\n\n- **json** Serve any existing JSON file to the network or start from\n scratch. Supports unlimited nested dictionaries.\n\n- **fast** Serve up to 20,000 queries per second on cache hit heavy workloads.\n Database is kept in memory, no disk reads are made after startup.\n\n- **persistance** Writes are queued and saved to disk once per second.\n\n- **lightweight** Less than 2,000 lines of Python and no external dependencies\n outside of the standard library.\n\n-----\n\nExample Python API usage, check ``pydoc3 apocrypha.client`` for full usage and\nmore examples.\n\n.. code-block:: python\n \n from apocrypha.client import Client\n db = Client()\n \n # apocrypha supports lists, strings, and dictionaries\n for i in range(0, 100):\n db.append('numbers', value=i)\n \n print(db.get('numbers')[:10])\n\n # nested dictionaries are allowed!\n customers = {\n 'alice': {\n 'age': 30\n },\n 'bob' : {\n 'age': 20\n }\n }\n\n db.set('customers', value=customers)\n print(db.keys('customers'))\n\n # query for sub keys with a simple syntax\n print(db.get('customers', 'alice', 'age'))\n\n for customer in db.keys('customers'):\n print(db.get('customers', customer, 'age'))\n\n-----\n\nA simple C client is available here_ if you want faster start up times than\nPython for client applications, like shell scripts.\n\n.. _here: https://github.com/Gandalf-/DotFiles/blob/master/bin/d.c\n\nThe network protocol is simple: send the length of the message in bytes, then\nthe message. Query elements are delimited by newlines. Each message ends in a\nnewline, and newlines are included in the length calculation of the message.\n\n\nindex\n=====\n\nindex further into the database through a key, then recursively display all\nkeys and values under the key. this is the usual way to traverse the database\nand gather information\n\n::\n\n (dict a, str b, b in a) => a b -> IO\n\n $ d apples granny = good\n $ d apples\n {'granny': 'good'}\n $ d apples granny\n good\n\nappend\n======\n\nappend a list or string to an existing string or list. create the left side if\nit doesn't already exist\n\n::\n\n (none a | str a | list a, str b | list b) => a + b -> none | error\n\n $ d toppings = mushrooms\n $ d toppings + pineapple\n $ d toppings\n mushrooms\n pineapple\n\n\nremove\n======\n\nremove one or more elements from a list. if the resulting list now only\ncontains one element, it's converted to a singleton\n\n::\n\n (list a, str b | list b, b in a) => a - b -> none | error\n\n $ d sweets = cake pie pizza\n $ d sweets - pizza\n $ d sweets\n cake\n pie\n\nassign\n======\n\nassign the value of an element. if multiple arguments are given on the right\nside of the assignment, the result is list assignment\n\n::\n\n (any a, str b | list b) => a = b -> none\n\n $ d apple = sauce pie\n $ d apple\n sauce\n pie\n\nsearch\n======\n\nrecursively search the current level for a value. displays all the keys that\ncorrespond have the value's value\n\n::\n\n (str a) => IO\n\n $ d rasp = berry\n $ d blue = berry\n $ d @ berry\n rasp\n blue\n\nkeys\n====\n\nshow the keys immediately under this value. doesn't recursively print all keys\nand values underneathe\n\n::\n\n dict a => a --keys -> IO | error\n\n $ d stone sand = weak\n $ d stone lime = tough\n $ d stone --keys\n sand\n lime\n\nset\n===\n\nreplace the value of an index with raw JSON\n\n::\n\n (any a, str b, JSON b) => a --set b -> none | error\n\n $ d pasta --set '[\"spaghetti\", \"lasgna\"]'\n $ d pasta\n spaghetti\n lasagna\n\nedit\n====\n\ndump the raw JSON value of a key. \n\n::\n\n any a => a --edit -> IO\n\n $ d pasta = spaghetti sauce\n $ d pasta --edit\n '[\"spaghetti\", \"sauce\"]'\n\ndelete\n======\n\ndelete any element from it's parent dictionary\n\n::\n\n any a => a --del -> none\n\n $ d apple sauce = good\n $ d apple pie = great\n $ d apple sauce --del\n $ d apple\n {'pie': 'great'}", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/Gandalf-/apocrypha/archive/2.1.0tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Gandalf-/apocrypha", "keywords": "database,json", "license": "", "maintainer": "", "maintainer_email": "", "name": "apocrypha", "package_url": "https://pypi.org/project/apocrypha/", "platform": "", "project_url": "https://pypi.org/project/apocrypha/", "project_urls": { "Download": "https://github.com/Gandalf-/apocrypha/archive/2.1.0tar.gz", "Homepage": "https://github.com/Gandalf-/apocrypha" }, "release_url": "https://pypi.org/project/apocrypha/2.1.0/", "requires_dist": null, "requires_python": "", "summary": "A lightweight, flexible JSON server and client", "version": "2.1.0" }, "last_serial": 4102739, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "6c9193cc48bcb1d753130c2d42b25c00", "sha256": "6d725b4482e66d019cb8b5ee7a764671c05cf73f313317b42c8ac37f3c5d4ad8" }, "downloads": -1, "filename": "apocrypha-0.1.tar.gz", "has_sig": false, "md5_digest": "6c9193cc48bcb1d753130c2d42b25c00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7324, "upload_time": "2018-03-25T06:33:05", "url": "https://files.pythonhosted.org/packages/9a/86/f9ecdcf5a905ef6046ae4a03247413f88c1e1644d09041183b3142b97312/apocrypha-0.1.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "99bfc551b0723e95021c30a176a2af24", "sha256": "9c2f554d2cbc40c22f698ca64b1bdd0471f24569cceaa318c3e6d417cd53efa0" }, "downloads": -1, "filename": "apocrypha-1.0.1.tar.gz", "has_sig": false, "md5_digest": "99bfc551b0723e95021c30a176a2af24", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15383, "upload_time": "2018-03-25T15:49:50", "url": "https://files.pythonhosted.org/packages/51/61/e1d2270610c996d9d506ae3848b2c51a8aeb681315ec8468fb16a4b325b6/apocrypha-1.0.1.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "a1b698e64b00e2b5233a6ecb2ef36a30", "sha256": "772b1cd81493078799d0ac5c851a6404d4ccb76a19b278d03bf6aaaac558ae12" }, "downloads": -1, "filename": "apocrypha-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a1b698e64b00e2b5233a6ecb2ef36a30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15390, "upload_time": "2018-03-25T15:50:58", "url": "https://files.pythonhosted.org/packages/9b/48/be94a2385a6202ec3f4a5dd7d37c51adee9bf909176e01a7b4d7f4d45b1f/apocrypha-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "25f5756d51bfbdb65a278cd369196bb8", "sha256": "d0eb1210aec559ecd78608721593c27da8161df63837ec7599722d9e1f9256a7" }, "downloads": -1, "filename": "apocrypha-1.0.4.tar.gz", "has_sig": false, "md5_digest": "25f5756d51bfbdb65a278cd369196bb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16273, "upload_time": "2018-03-26T00:16:53", "url": "https://files.pythonhosted.org/packages/53/77/0112754651affda73e22fc521b321ae9947266e3780f70b1c51812833ecc/apocrypha-1.0.4.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "ba85ce7d9575885ece8700372a7ccb66", "sha256": "5a7ba8f23d7f1fbd570d452b583bef2b2fe8093b84a3ed0ba7f6756945f1ccd7" }, "downloads": -1, "filename": "apocrypha-1.1.0.tar.gz", "has_sig": false, "md5_digest": "ba85ce7d9575885ece8700372a7ccb66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16248, "upload_time": "2018-03-27T04:11:49", "url": "https://files.pythonhosted.org/packages/59/94/8362059ba3c10b44b9d2e39bbc372f2d0a280b465041f4b71f9837073d63/apocrypha-1.1.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "63fcb6699ee9751acfca642ba3a1bc15", "sha256": "96da9620c35adee5981c335101f37444fbb3f9e3170ab6d3168cd8800d0318c1" }, "downloads": -1, "filename": "apocrypha-2.0.0.tar.gz", "has_sig": false, "md5_digest": "63fcb6699ee9751acfca642ba3a1bc15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20639, "upload_time": "2018-05-05T17:14:29", "url": "https://files.pythonhosted.org/packages/b0/47/f71dca68eb55c8bc6893f93c9049d60e834b125d927dc8993b15c0e9e251/apocrypha-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "14f5f63ac580410222b56a34b6f99f12", "sha256": "f1b9c4f51d96d9bf581efd5d051ff372467e7112933761785d481bf2ec26eb8d" }, "downloads": -1, "filename": "apocrypha-2.0.1.tar.gz", "has_sig": false, "md5_digest": "14f5f63ac580410222b56a34b6f99f12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21452, "upload_time": "2018-05-17T03:35:00", "url": "https://files.pythonhosted.org/packages/eb/60/bb88dba0aae287f6a89291bd98c3a94ac299ee3860393af771920bbb0aa8/apocrypha-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "b37f795900f3a8951fdddcd6afa461ef", "sha256": "a2e236b61ea89a5da30a07e8f7797b1e1c80d01d5a5f922fa92f2cf9c31caef7" }, "downloads": -1, "filename": "apocrypha-2.0.2.tar.gz", "has_sig": false, "md5_digest": "b37f795900f3a8951fdddcd6afa461ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22645, "upload_time": "2018-06-16T17:03:18", "url": "https://files.pythonhosted.org/packages/e1/42/18d31a2f4e3ceec791c047fc4c39bd47a06842421b8f2b102e9cce941d90/apocrypha-2.0.2.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "dff40cd2a731b4cbaf4572e0df15a3b9", "sha256": "35da3234889a4958c81f60a657e80d883eae6d9830a34bdbd50430200939316a" }, "downloads": -1, "filename": "apocrypha-2.0.3.tar.gz", "has_sig": false, "md5_digest": "dff40cd2a731b4cbaf4572e0df15a3b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22672, "upload_time": "2018-06-24T03:38:50", "url": "https://files.pythonhosted.org/packages/18/ae/6fdfd59031014720b455f22213219ae2cf2809b0b74400c27d4642fc1e7c/apocrypha-2.0.3.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "acdc487d3e23e7b9fa5c27ced5259d54", "sha256": "2abdd631ade34b77203a9b6a8962f769db069ad91cb533958d8787e7eea6fd4e" }, "downloads": -1, "filename": "apocrypha-2.1.0.tar.gz", "has_sig": false, "md5_digest": "acdc487d3e23e7b9fa5c27ced5259d54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33518, "upload_time": "2018-07-26T02:20:12", "url": "https://files.pythonhosted.org/packages/dd/47/1051ca15d97a246441fc39a6c94712f80112ba354948c52c5560a2d08066/apocrypha-2.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "acdc487d3e23e7b9fa5c27ced5259d54", "sha256": "2abdd631ade34b77203a9b6a8962f769db069ad91cb533958d8787e7eea6fd4e" }, "downloads": -1, "filename": "apocrypha-2.1.0.tar.gz", "has_sig": false, "md5_digest": "acdc487d3e23e7b9fa5c27ced5259d54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33518, "upload_time": "2018-07-26T02:20:12", "url": "https://files.pythonhosted.org/packages/dd/47/1051ca15d97a246441fc39a6c94712f80112ba354948c52c5560a2d08066/apocrypha-2.1.0.tar.gz" } ] }