{ "info": { "author": "Natsuko H.", "author_email": "nokusukun@yahoo.co.jp", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# TashoDB \n\nA fast and portable python NoSQL database. Sucessor to KoDB.\n\n#### Using the DB\n\nTo initalize or open a database, it's as straightforward as calling `tasho.Database.new` or `tasho.Database.open`.\n```python\n>>> import tasho\n>>> database = tasho.Database.new(\"AnimeDatabase\") # Creates a new database.\n>>> database = tasho.Database.open(\"AnimeDatabase\") # Opens a database.\n```\n\nTables can be called through `tasho.Database.get_table(table_name)` or through `tasho.Database.table.table_name` \n```python\n>>> tbl_anime = database.table.Anime \t\t\t# These all return \n>>> tbl_anime = database.get_table(\"Anime\")\t\t# the same Table\n>>> tbl_anime = database.table['Anime']\t\t\t# object.\n>>> tbl_anime\n: Anime | Chunks: 1\n```\n\n***Note: Tables are set to auto commit by default. When doing bulk inserts, make sure to set `Table.auto_commit` to `False` and running `Table.commit()` manually afterwards.***\n\n\n#### Data Storage\n```python\n>>> tbl_anime.insert('001', {'title': 'Nichijou', 'episodes': 24, 'rating': 99})\n'Shows-d545998bc3485346'\n```\n\nThis stores the data with `001` as the Document ID. Document IDs can either be String or Int. Since `Table.auto_commit` has been set to true, running `Table.commit()` is no longer needed.\n\n\n#### Retrieval\nThere are multiple ways of accessing data.\n```python\n# The document can be accessed through a regular get method\n>>> show = tbl_shows.get('001')\n>>> show\n Origin: Shows\n>>> show.dict\n{'title': 'Nichijou', 'episodes': 24, 'rating': 99, '_id': '001'}\n>>>\n# Table.query allows you to pass a callable to filter the data.\n>>> tbl_shows.query(lambda id, data: data['rating'] > 50)\n[ Origin: Shows]\n>>>\n# Table.query_one works the same as Table.query but stops at the first match.\n>>> tbl_shows.query_one(lambda id, data: data['rating'] > 50)\n Origin: Shows\n```\n`Table.get(id)` returns a Document object that contains the data.\n\n\n#### Manipulating Data\n\nManipulating data is as easy as changing the values in the Document object.\n```python\n>>> show\n Origin: Shows\n>>> show.dict\n{'title': 'Nichijou', 'episodes': 24, 'rating': 99, '_id': '001'}\n>>> show.rating = 98\n>>> show['title'] = 'Nichibros'\n>>> show.save()\n'Shows-d545998bc3485346'\n>>> show.dict\n{'title': 'Nichibros', 'episodes': 24, 'rating': 98, '_id': '001'}\n```\n\n\nDocument deletion can also be done with `Document.delete()`.\n```python\n>>> list(tbl_shows.items())\n[('001', {'title': 'Nichijou', 'episodes': 24, 'rating': 98})]\n>>> show.delete()\nTrue\n>>> list(tbl_shows.items())\n[]\n```\n\n***Note: Document objects behaves almost the same way as dictionaries. `Document.pop`, `Document.update` and `Document.get` works the same way.***\n\n_See: test.py for more use cases._\n\n\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/nokusukun/TashoDB", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "tasho", "package_url": "https://pypi.org/project/tasho/", "platform": "", "project_url": "https://pypi.org/project/tasho/", "project_urls": { "Homepage": "https://github.com/nokusukun/TashoDB" }, "release_url": "https://pypi.org/project/tasho/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "A performant and lightweight NOSQL Database", "version": "0.0.3" }, "last_serial": 5087003, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "9ea24d30e392931fff35b8d692e893be", "sha256": "c49611148cf0892fbe7ae3fc8ddfb2fba69a7f9add90a1a09e21382d3ff09df6" }, "downloads": -1, "filename": "tasho-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "9ea24d30e392931fff35b8d692e893be", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10671, "upload_time": "2019-04-03T08:56:08", "url": "https://files.pythonhosted.org/packages/f5/44/b50ec09998d2b3cf71c90b6dc8dda4a3b1f4f83d6c121eb21943099d19e2/tasho-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8865cb44e4dd235fc26f3b9d12070108", "sha256": "372cc718ff108cb57fb7f362635ddae9f9e5f7e39f2ee290fb19d0a803c717b8" }, "downloads": -1, "filename": "tasho-0.0.3.tar.gz", "has_sig": false, "md5_digest": "8865cb44e4dd235fc26f3b9d12070108", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8740, "upload_time": "2019-04-03T08:56:11", "url": "https://files.pythonhosted.org/packages/98/7a/d17f6566661c0874a5d413f3ca8da39e6f88d160b1968ef4e65f4853bb14/tasho-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9ea24d30e392931fff35b8d692e893be", "sha256": "c49611148cf0892fbe7ae3fc8ddfb2fba69a7f9add90a1a09e21382d3ff09df6" }, "downloads": -1, "filename": "tasho-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "9ea24d30e392931fff35b8d692e893be", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10671, "upload_time": "2019-04-03T08:56:08", "url": "https://files.pythonhosted.org/packages/f5/44/b50ec09998d2b3cf71c90b6dc8dda4a3b1f4f83d6c121eb21943099d19e2/tasho-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8865cb44e4dd235fc26f3b9d12070108", "sha256": "372cc718ff108cb57fb7f362635ddae9f9e5f7e39f2ee290fb19d0a803c717b8" }, "downloads": -1, "filename": "tasho-0.0.3.tar.gz", "has_sig": false, "md5_digest": "8865cb44e4dd235fc26f3b9d12070108", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8740, "upload_time": "2019-04-03T08:56:11", "url": "https://files.pythonhosted.org/packages/98/7a/d17f6566661c0874a5d413f3ca8da39e6f88d160b1968ef4e65f4853bb14/tasho-0.0.3.tar.gz" } ] }