{
"info": {
"author": "Geoffrey Leh\u00c3\u00a9e",
"author_email": "hello@socketubs.org",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.0",
"Programming Language :: Python :: 3.1",
"Programming Language :: Python :: 3.2"
],
"description": "======\nSofart\n======\n\n.. image:: https://secure.travis-ci.org/socketubs/sofart.png?branch=master\n :target: https://travis-ci.org/socketubs/sofart\n\nPython in-memory embedded and non-relational database.\n\nFor development and test, heavily inspired by `Mongodb `_.\n\nThere are three serializers at this time, ``msgpack``, ``Pickle`` and ``Json`` for storage.\n\nSofart can be use in-memory synced with ``multi`` mode..\n\n\tSofart is Python 3 ready.\n\nInstallation\n------------\n\nInstall with pip: ::\n\n\tpip install sofart\n\nExample\n-------\n\nEasy use: ::\n\n\t>>> from sofart import Database\n\nCreate Database and a collection: ::\n\n\t>>> db = Database('/tmp/so.fart')\n\t>>> db.create_collection('test_collection')\n\t>>> db.collection_names()\n\t['test_collection']\n\nPlay with collection: ::\n\n\t>>> c = db.test_collection\n\t>>> post = {\"artist\": \"Jambon\",\n\t... \"track\": \"I love my jambon\"}\n\t>>> c.save(post)\n\t>>> for i in c.find_one():\n\t... print(i)\n\t...\n\t{'track': 'I love my jambon', '_id': 'b2d6bf60-6c11-4e26-9357-efb28056e60d', 'artist': 'Jambon'}\n\t>>> c.remove('b2d6bf60-6c11-4e26-9357-efb28056e60d')\n\t>>> c.find_one()\n\nSome filter: ::\n\n\t>>> c.find_one({\"artist\": \"Jambon\"})\n\t{'track': 'I love my jambon', '_id': 'b2d6bf60-6c11-4e26-9357-efb28056e60d', 'artist': 'Jambon'}\n\t>>> c.find_one({\"artist\":\"Bieber\"})\n >>>\n\nTests\n-----\n\nYou can run test under ``tests/test_sofart.py``.\nAnd there is a populate script into ``tests/populate.py``.\n\nPerformances\n------------\n\n\tSingle(in-memory) is highly faster than ``multi`` cause it's mainly work in RAM and just down data when sync method is called.\n\tIn otherwise ``multi`` down data at each request.\n\nBut you can have a pretty data control with ``sync`` method which down data in file when you call it.\n\nSerializers\n-----------\n\n========== === === ====\nSerializer Py2 Py3 Pypy\n========== === === ====\nJson 1 1 1\nMsgPack 1 1 X\nPickle 1 1 1\n========== === === ====\n\nPypy and ``msgpack-pure`` are not supported.\n\nMisc.\n-----\n\nYou can easily write your own serializer, have a look at ``serializers/_msgpack.py`` or ``_json.py`` file.\n\nRemember that if someone write Ruby or other language driver for sofart, maybe using ``json`` or ``msgpack`` could be a good idea.\n\nDocs\n----\n\nclass Database\n==============\n\n*constructor* ::\n\n Database(str(path), str(mode), str(serializer)) : Path is database file path\n : Mode is single or multi (Default: `single`)\n : Serializer like msgpack, json or pickle (Default: `json`)\n\n*attributs* ::\n\n path: Return database path\n\n*methods* ::\n\n create_collection(str(name)) : Create new collection\n drop_collection(str(name)) : Drop collection\n rename(str(name), str(new_name)): Rename collection `name` to `new_name`\n collection_names(): Return database collections list (same as `collections` attribut)\n count() : Return total database entries\n sync() : Save every changes in database file\n\nRetrieve collection with the followings methods:\n\n::\n\n c = db.my_collection\n c = db['my_collection']\n\nclass Collection\n================\n\n*attributs* ::\n\n name: Return collection name\n\n*methods* ::\n\n drop() : Drop collection\n count() : Return total collection entries\n save(dict(enreg)): Save entry into collection\n remove(str(_id)) : Remove entry from collection\n sync() : Save every changes in database file\n rename(str(name)): Rename collection to `name`\n find_one(spec_or_id) : Return first founded result\n find(dict(spec_or_id), int(limit)): Iterator which return `limit` result founded (limit=0 return all)\n\nQuery\n-----\n\nAt this moment just following operands are available:\n\n- ``<``\n- ``<=``\n- ``>``\n- ``>=``\n- ``all``\n- ``exists``\n- ``mod``\n- ``ne``\n- ``in``\n- ``nin``\n\nThis is an example: ::\n\n\t>>> c.save({\"value\": 2})\n\t>>> c.find({\"value\": {\"$exists\": True}})\n\t[{'_id': '47e53aea-85b4-434b-8961-40e89c877b41', 'value': 2}]\n\t>>> c.find({\"value\": {\"$in\": [2, 3, 67]}})\n\t[{'_id': '47e53aea-85b4-434b-8961-40e89c877b41', 'value': 2}]\n\t>>> c.find({\"value\" : { \"$gt\": 1 }})\n\t[{'_id': '42567296-7d78-43b7-a4e0-50447b80eca8', 'value': 2}]\n\nAnd another: ::\n\n\t>>> c.find({\"value\" : { \"$gte\": 2 }})\n\t[{'_id': '42567296-7d78-43b7-a4e0-50447b80eca8', 'value': 2}]\n\t>>> c.find({\"value\" : { \"$gte\": 2, \"$lt\" : 1 }})\n\t[]\n\t>>> c.find({\"value\": {\"$mod\": [2, 0]}})\n\t[{'_id': '47e53aea-85b4-434b-8961-40e89c877b41', 'value': 2}]\n\nMore informations `here `_.\n\nSee `LICENSE `_.",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "UNKNOWN",
"keywords": null,
"license": "Copyright (c) 2012, Geoffrey Leh\u00e9e\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n * Neither the name of the nor the\n names of its contributors may be used to endorse or promote products\n derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
"maintainer": null,
"maintainer_email": null,
"name": "sofart",
"package_url": "https://pypi.org/project/sofart/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/sofart/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "UNKNOWN"
},
"release_url": "https://pypi.org/project/sofart/0.3.5/",
"requires_dist": null,
"requires_python": null,
"summary": "Python in-memory embedded and non-relationnal database",
"version": "0.3.5"
},
"last_serial": 2246824,
"releases": {
"0.3.4": [],
"0.3.5": [
{
"comment_text": "",
"digests": {
"md5": "5fd730bac41396c3ef8f1c8dc6364b04",
"sha256": "f18a71920a9841aa4416f5bd5ecc7d7eb76cec46bc9f8f2344610402c56dd9fa"
},
"downloads": -1,
"filename": "sofart-0.3.5.tar.gz",
"has_sig": false,
"md5_digest": "5fd730bac41396c3ef8f1c8dc6364b04",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8706,
"upload_time": "2016-07-27T12:12:35",
"url": "https://files.pythonhosted.org/packages/b1/53/8cfb565f959a838f8f07ea790fde5ab9e1575a52b1457e6003b348183f99/sofart-0.3.5.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "5fd730bac41396c3ef8f1c8dc6364b04",
"sha256": "f18a71920a9841aa4416f5bd5ecc7d7eb76cec46bc9f8f2344610402c56dd9fa"
},
"downloads": -1,
"filename": "sofart-0.3.5.tar.gz",
"has_sig": false,
"md5_digest": "5fd730bac41396c3ef8f1c8dc6364b04",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8706,
"upload_time": "2016-07-27T12:12:35",
"url": "https://files.pythonhosted.org/packages/b1/53/8cfb565f959a838f8f07ea790fde5ab9e1575a52b1457e6003b348183f99/sofart-0.3.5.tar.gz"
}
]
}