{ "info": { "author": "Stefane Fermigier - Abilian", "author_email": "sf@abilian.com", "bugtrack_url": null, "classifiers": [], "description": "# Blitz-DB3\n\n[![Build Status](https://travis-ci.org/abilian/blitzdb3.svg?branch=master)](https://travis-ci.org/abilian/blitzdb3)\n[![PyPI](https://img.shields.io/pypi/v/blitzdb3.svg?maxAge=1000)](https://pypi.python.org/pypi/blitzdb3)\n\n**BlitzDB3** is a port of BlitzDB to Python 3. We're using BlitzDB on some internal projects at [Abilian](https://www.abilian.com/) and needed these changes to migrate these projects to Python 3.\n\n**BlitzDB**, or just **Blitz** is a document-based, object-oriented, transactional database written purely in Python. Among other things, it provides a **powerful querying language**, **deep indexing of documents**, **compressed data storage** and **automatic referencing of embedded documents**. It is reasonably fast, can be easily embedded in any Python application and does not have any external dependencies (except when using a third-party backend). In addition, you can use it as a **frontend** to other database engines such as MongoDB in case you should need more power.\n\n## Key Features\n\n* Document-based, object-oriented interface.\n* Powerful and rich querying language.\n* Deep document indexes on arbitrary fields.\n* Compressed storage of documents.\n* Support for multiple backends (e.g. file-based storage, MongoDB).\n* Support for database transactions (currently only for the file-based backend).\n\n## Use Cases\n\nBlitz can be used as a standalone document store for client application. Originally blitz was designed for use with the [checkmate](https://github.com/quantifiedcode/checkmate) Python code analysis toolkit, where it stores statistical data. Since blitz stores all documents as single JSON files, it is possible to put the whole database under version-control.\n\n## Installation\n\nThe easiest way to install Blitz is through **pip** or **easy_install**\n\n pip install blitzdb\n #or...\n easy_install blitzdb\n\nFor more detailed installation instructions, have a look at the [documentation](http://blitzdb.readthedocs.org).\n\n## Detailed Documentation\n\nThe detailed documentation for this project is hosted on [ReadTheDocs](http://blitzdb.readthedocs.org), feel free to take a look!\n\n## Roadmap\n\n* 3.2 (unreleased): keep fixing and upgrading.\n* 3.1 (unreleased): drop support for Python 2.\n\n## Changelog\n\n* 3.0a1: Port to Python 3 using six. Cleanup and format code. \n\n## Old Changelog (original Blitzdb by Andreas Dewes / andreas@7scientists.com)\n\n* 0.4.4: SQL backend: Do not coerce server_default values via a CAST, as this can cause incompatibilities.\n* 0.4.3: Many small improvements to the SQL backend.\n* 0.3.0: Fully functional SQL backend.\n* 0.2.12: Added support for proper attribute iteration to `Document`.\n* 0.2.11: Allow setting the `collection` parameter through a `Document.Meta` attribute.\n* 0.2.10: Bugfix-Release: Fix Python 3 compatibility issue.\n* 0.2.9: Bugfix-Release: Fix serialization problem with file backend.\n* 0.2.8: Added `get`, `has_key` and `clear` methods to `Document` class\n* 0.2.7: Fixed problem with __unicode__ function in Python 3.\n* 0.2.6: Bugfix-Release: Fixed an issue with the $exists operator for the file backend.\n* 0.2.5: Bugfix-Release\n* 0.2.4: Added support for projections and update operations to the MongoDB backend.\n* 0.2.3: Bugfix-Release: Fixed bug in transaction data caching in MongoDB backend.\n* 0.2.2: Fix for slice operators in MongoDB backend.\n* 0.2.1: Better tests.\n* 0.2.0: Support for including additional information in DB references. Support for accessing document attributes as dictionary items.\n Added $regex parameter that allows to use regular expressions in queries.\n* 0.1.5: MongoDB backend now supports database transactions. Database operations are now read-isolated by default, i.e.\n uncommitted operations will not affect database queries before they are committed.\n* 0.1.4: Improved indexing of objects for the file backend, added support for automatic serialization/deserialization\n of object attributes when adding keys to or querying an index.\n* 0.1.3: Sorting of query sets is now supported (still experimental)\n* 0.1.2: Small bugfixes, BlitzDB version number now contained in DB config dict\n* 0.1.1: BlitzDB is now Python3 compatible (thanks to David Koblas)\n\n## Contributors (in alphabetical order)\n\n### Current maintainer (BlitzDB3)\n\n* Stefane Fermigier - @sfermigier\n\n### Original author (BlitzDB)\n\n* Andreas Dewes - @adewes\n\n### Original contributors\n\n* @bwiessneth\n* Florian Lehmann - @cashaddy\n* Karskrin - @cBrauge\n* Chris Mutel - @cmutel\n* Cecil Woebker - @cwoebker\n* Ethan Blackburn - @EthanBlackburn\n* Javier Collado - @jcollado\n* Jason Xie - @jxieeducation\n* David Koblas - @koblas\n* St\u00e9phane Wirtel - @matrixise\n* Victor Miclovich - @miclovich\n* Dmytro Kyrychuk - @orgkhnargh\n* Christoph Neumann - @programmdesign\n* Dale - @puredistortion\n* tjado - @tejado\n* Thomas Ballinger - @thomasballinger\n* Tyler Kennedy - @TkTech\n* Toby Champion - @tobych\n\nThanks for all your contributions, without you BlitzDB wouldn't be what it is today :)\n\n## Third-Party Contributions\n\n* [Flask-BlitzDB](https://github.com/puredistortion/flask-blitzdb) Flask adapter for BlitzDB. Blitz + Flask = Awesome!\n\n## Examples\n\nTo get an idea of what you can do with Blitz, here are some examples.\n\n### Creating objects\n\n```python\nfrom blitzdb import Document\n\nclass Movie(Document):\n pass\n\nclass Actor(Document):\n pass\n\nthe_godfather = Movie({'name': 'The Godfather','year':1972,'pk': 1})\n\nmarlon_brando = Actor({'name':'Marlon Brando','pk': 1})\nal_pacino = Actor({'name' : 'Al Pacino','pk': 1})\n```\n\n### Storing objects in the database:\n\n```python\nfrom blitzdb import FileBackend\n\nbackend = FileBackend(\"/path/to/my/db\")\n\nthe_godfather.save(backend)\nmarlon_brando.save(backend)\nal_pacino.save(backend)\n```\n\n### Retrieving objects from the database:\n\n```python\nthe_godfather = backend.get(Movie, {'pk': 1})\n#or...\nthe_godfather = backend.get(Movie, {'name' : 'The Godfather'})\n```\n\n### Filtering objects\n\n```python\nmovies_from_1972 = backend.filter(Movie, {'year' : 1972})\n```\n\n### Working with transactions\n\n```python\nbackend.begin()\nthe_godfather.director = 'Roland Emmerich' #oops...\nthe_godfather.save()\nbackend.rollback() #undo the changes...\n```\n\n### Creating nested object references\n\n```python\nthe_godfather.cast = {'Don Vito Corleone' : marlon_brando, 'Michael Corleone' : al_pacino}\n\n#Documents stored within other objects will be automatically converted to database references.\n\nmarlon_brando.performances = [the_godfather]\nal_pacino.performances = [the_godfather]\n\nmarlon_brando.save(backend)\nal_pacino.save(backend)\nthe_godfather.save(backend)\n#Will store references to the movies within the documents in the DB\n```\n\n### Creation of database indexes and advanced querying\n\n```python\nbackend.create_index(Actor,'performances')\n#Will create an index on the 'performances' field, for fast querying\n\ngodfather_cast = backend.filter(Actor,{'movies' : the_godfather})\n#Will return 'Al Pacino' and 'Marlon Brando'\n```\n\n### Arbitrary filter expressions\n\n```python\nstar_wars_iv = Movie({'name' : 'Star Wars - Episode IV: A New Hope','year': 1977})\nstar_wars_iv.save()\n\nmovies_from_the_seventies = backend.filter(Movie,{'year': lambda year : year >= 1970 and year < 1980})\n#Will return Star Wars & The Godfather (man, what a decade!)\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/abilian/blitzdb3", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "blitzdb3", "package_url": "https://pypi.org/project/blitzdb3/", "platform": "", "project_url": "https://pypi.org/project/blitzdb3/", "project_urls": { "Homepage": "https://github.com/abilian/blitzdb3" }, "release_url": "https://pypi.org/project/blitzdb3/3.0a3/", "requires_dist": null, "requires_python": "", "summary": "A document-oriented database written purely in Python (Python 3 fork).", "version": "3.0a3" }, "last_serial": 5600940, "releases": { "3.0a1": [ { "comment_text": "", "digests": { "md5": "0a849b6b6b6f2567a1fbc488ecea07dd", "sha256": "59145580b871841612db1297641829a61c3d956473ec51e20492a6924a1265ee" }, "downloads": -1, "filename": "blitzdb3-3.0a1.tar.gz", "has_sig": false, "md5_digest": "0a849b6b6b6f2567a1fbc488ecea07dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67015, "upload_time": "2019-07-26T13:34:35", "url": "https://files.pythonhosted.org/packages/d7/80/bf894a9b61f14def93cecd5c12c7b58525a6bfe319f1a5d734507941b78b/blitzdb3-3.0a1.tar.gz" } ], "3.0a2": [ { "comment_text": "", "digests": { "md5": "9d8f772527d94184c0c006940ed3bb09", "sha256": "93521a6a8c3d748345aa5a8e09b1328ff12e6ab1e23cbf88043677fad5934fd9" }, "downloads": -1, "filename": "blitzdb3-3.0a2.tar.gz", "has_sig": false, "md5_digest": "9d8f772527d94184c0c006940ed3bb09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67321, "upload_time": "2019-07-27T17:48:17", "url": "https://files.pythonhosted.org/packages/18/f1/ea61591488f6e5641a6e5f54a0ff6e04f656e33088967112ab9c18ecc25a/blitzdb3-3.0a2.tar.gz" } ], "3.0a3": [ { "comment_text": "", "digests": { "md5": "65f9e6b1713b66adcfb4f44117e68270", "sha256": "97c2ca7619a46cfdabcd67035ff5fd4b8f7c221fb52f4476e518e1add2801659" }, "downloads": -1, "filename": "blitzdb3-3.0a3.tar.gz", "has_sig": false, "md5_digest": "65f9e6b1713b66adcfb4f44117e68270", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67323, "upload_time": "2019-07-29T18:06:07", "url": "https://files.pythonhosted.org/packages/ff/b3/0dc5bc32a3ba3a5e73631bb5bd3e0f930e6b8c2677587af5891c33e2e38c/blitzdb3-3.0a3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "65f9e6b1713b66adcfb4f44117e68270", "sha256": "97c2ca7619a46cfdabcd67035ff5fd4b8f7c221fb52f4476e518e1add2801659" }, "downloads": -1, "filename": "blitzdb3-3.0a3.tar.gz", "has_sig": false, "md5_digest": "65f9e6b1713b66adcfb4f44117e68270", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67323, "upload_time": "2019-07-29T18:06:07", "url": "https://files.pythonhosted.org/packages/ff/b3/0dc5bc32a3ba3a5e73631bb5bd3e0f930e6b8c2677587af5891c33e2e38c/blitzdb3-3.0a3.tar.gz" } ] }