{ "info": { "author": "Ty-Lucas Kelley", "author_email": "tylucaskelley@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Topic :: Database", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Bx\n\nIn-memory storage for Python\n\n![build-status](https://travis-ci.org/tylucaskelley/bx-python.svg?branch=master)\n![version](https://pypip.in/version/bx/badge.svg)\n![downloads](https://pypip.in/download/bx/badge.svg)\n\n---\n\n```\n __\n ___~~~` `~~__\n ___~~~ `~~_\n |~_ `~_\n | ~_ ___ ~~ |\n | ~_ __~~~ |\n | ~_ __~~~ |\n | | |\n | | |\n | | bx |\n ~_ | __|\n ~_ | __~~~\n ~_ | __~~~\n ~|__~~~\n```\n\nbx lets you store things in memory. It has a few special features:\n\n* Thread safe\n* Setting a timeout before object is destroyed\n* JSON Schema validation\n* Clean & simple API\n* Badass ASCII art\n* Supports Python 2.7 and 3.4\n\n## Installation\n\nJust make sure you have Python 2.7.x or 3.4.x and pip installed:\n\n```bash\n$ pip install bx\n```\n\n## Usage\n\nThe code is pretty simple and well-commented, but here's some example usage. If\nyou want more detail, run `pydoc bx.Db` once you've installed it or look through\nthe code to get info.\n\n```python\nimport bx\n\nstudent = {\n 'title': 'student',\n 'type': 'object',\n 'required': ['name', 'major', 'gpa'],\n 'properties': {\n 'name': {\n 'type': 'string'\n },\n 'major': {\n 'type': 'string'\n },\n 'gpa': {\n 'type': 'number'\n }\n }\n}\n\n# The schema argument defaults to None, and there is also an optional\n# debug mode (for console logging) that defaults to False\ndb = bx.Db(schema=student)\n\ntry:\n db.put('bad', 'data')\nexcept bx.db.ValidationError: # same as jsonschema.exceptions.ValidationError\n print('This does not fit the schema!')\n\njohn = {\n 'name': 'John Doe',\n 'major': 'Computer Science',\n 'gpa': 3.6\n}\n\nsusan = {\n 'name': 'Susan Jones',\n 'major': 'Physics',\n 'gpa': 3.96\n}\n\ndb.put('john', john)\ndb.put('susan', susan)\n\n# get average gpa\nprint(sum([v['gpa'] for v in db.vals()]) / len(db.vals()))\n\ndb.delete('susan')\n\ntry:\n db.delete('bob')\nexcept KeyError:\n print('bob is not in the data store!')\n```", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/tylucaskelley/bx-python/tarball/v0.3.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tylucaskelley/bx-python", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "bx", "package_url": "https://pypi.org/project/bx/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/bx/", "project_urls": { "Download": "https://github.com/tylucaskelley/bx-python/tarball/v0.3.0", "Homepage": "https://github.com/tylucaskelley/bx-python" }, "release_url": "https://pypi.org/project/bx/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "Simple in-memory storage for Python", "version": "0.3.0" }, "last_serial": 1369621, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "1c14af76e37c91297bebb3b51a20033d", "sha256": "1a1f671f90f626706a21cc452c5921356c105045cbe2175c6c15219da794cb45" }, "downloads": -1, "filename": "bx-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1c14af76e37c91297bebb3b51a20033d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4125, "upload_time": "2015-01-02T23:15:16", "url": "https://files.pythonhosted.org/packages/a5/af/4c33fc28a1137cd0ee19db2e0ded398b7ce45cba2f0d8884c7ad1e75d4fc/bx-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "0e703bf113e80e9043c696898f52d0b9", "sha256": "a1b59f43f3731e4d4dbb3a7783b6736f1892a9ddf9c583b6e4a9886d25d5bf99" }, "downloads": -1, "filename": "bx-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0e703bf113e80e9043c696898f52d0b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4251, "upload_time": "2015-01-02T23:34:37", "url": "https://files.pythonhosted.org/packages/53/23/c38f39ecf45778d17ed6e61b4f8644dcbe9d095fb3cb71c578324b9a3633/bx-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "1e63ef261981fe9188a42351a5df413b", "sha256": "3a75bced6ade4655257b0e1678bf694804dcd5109659d6563bd99fbdce6d5db5" }, "downloads": -1, "filename": "bx-0.2.1.tar.gz", "has_sig": false, "md5_digest": "1e63ef261981fe9188a42351a5df413b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4844, "upload_time": "2015-01-02T23:52:50", "url": "https://files.pythonhosted.org/packages/7d/3a/70a0572a7389d076b276c9db62c1195e73bb37b8ee6581e69e0398d87129/bx-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "f2089f80f74f5141713112292bc690b6", "sha256": "e940982782ce42d6e8a973af4daf64134b52cb1359336e09a5a4f8e4cf96f604" }, "downloads": -1, "filename": "bx-0.3.0.tar.gz", "has_sig": false, "md5_digest": "f2089f80f74f5141713112292bc690b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4869, "upload_time": "2015-01-04T00:44:00", "url": "https://files.pythonhosted.org/packages/66/f8/53217efe538d3d7373beca30b7d48715399f6dd780e3e6ce973d0fd622f7/bx-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f2089f80f74f5141713112292bc690b6", "sha256": "e940982782ce42d6e8a973af4daf64134b52cb1359336e09a5a4f8e4cf96f604" }, "downloads": -1, "filename": "bx-0.3.0.tar.gz", "has_sig": false, "md5_digest": "f2089f80f74f5141713112292bc690b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4869, "upload_time": "2015-01-04T00:44:00", "url": "https://files.pythonhosted.org/packages/66/f8/53217efe538d3d7373beca30b7d48715399f6dd780e3e6ce973d0fd622f7/bx-0.3.0.tar.gz" } ] }