{"id":13585595,"url":"https://github.com/alshapton/TinyMP","last_synced_at":"2025-04-07T10:31:14.601Z","repository":{"id":57475760,"uuid":"110472551","full_name":"alshapton/TinyMP","owner":"alshapton","description":"A MessagePack-based storage extension to tinydb using the http://msgpack.org","archived":true,"fork":false,"pushed_at":"2017-12-23T22:19:50.000Z","size":157,"stargazers_count":12,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T14:16:22.606Z","etag":null,"topics":["documentdb","messagepack","messagepack-format","msgpack","nosql","python","tinydb"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alshapton.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-12T21:57:00.000Z","updated_at":"2023-08-20T20:54:47.000Z","dependencies_parsed_at":"2022-09-07T13:51:36.929Z","dependency_job_id":null,"html_url":"https://github.com/alshapton/TinyMP","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshapton%2FTinyMP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshapton%2FTinyMP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshapton%2FTinyMP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshapton%2FTinyMP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alshapton","download_url":"https://codeload.github.com/alshapton/TinyMP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247636215,"owners_count":20970882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentdb","messagepack","messagepack-format","msgpack","nosql","python","tinydb"],"created_at":"2024-08-01T15:05:02.074Z","updated_at":"2025-04-07T10:31:14.365Z","avatar_url":"https://github.com/alshapton.png","language":"Python","readme":".. image:: artwork/tinymplogo.png\n    :scale: 100%\n    :height: 150px\n    \n.. image:: https://travis-ci.org/alshapton/TinyMP.svg?branch=master\n.. image:: https://snyk.io/test/github/alshapton/tinydb-msgpack/badge.svg\n.. image:: https://codecov.io/gh/alshapton/TinyMP/branch/master/graph/badge.svg\n.. image:: https://img.shields.io/badge/code%20style-pep8-orange.svg\n\n\n\nTinyMP is a storage backend for TinyDB https://github.com/msiemens/tinydb which is based around the MessagePack compressed JSON format (https://msgpack.org/index.html)   \n\nSyntax :\n========\nTinyMP extends the syntax of the ``tinydb`` class using one of the optional ``kwargs`` as follows:\n\n\n.. code:: python\n    class tinydb.database.TinyDB(*args, **kwargs)\n\n.. csv-table:: Values for ``**kwargs``\n   :header: \"Value\",\"Effect\"\n   :widths: 10,90\n\n   \"``storage=MsgPackStorage``\",\"Default option, will use the ``MsgPack`` library\"\n   \"``storage=MsgPackStorage,Lib='msgpack'``\",\"Will use the ``MsgPack`` library\"\n   \"``storage=MsgPackStorage,Lib='umsgpack'``\",\"Will use the ``U-MsgPack`` Library\"\n\n\nExample Usage:\n==============\n\n.. code:: python\n\n    from tinydb import TinyDB, Query\n    from tinymp import *\n\n    db = TinyDB('data.msg',storage=MsgPackStorage)\n    \n    def dbins():\n       db.insert({'type': 'apple', 'count': 7})\n    \n    dbins()\n\nAs you can see, it's a simple drop-in replacement for any storage engine\nand it can be nested and cached. Don't forget, you will need to install as a minimum,\nthe ``msgpack-python`` library using ``pip install msgpack-python`` and the ``U-MsgPack``\nlibrary from https://github.com/vsergeev/u-msgpack-python in order to use that option.\n\nExample Usage using alternative MessagePack Library:\n====================================================\n\n.. code:: python\n\n    from tinydb import TinyDB, Query\n    from tinymp import *\n\n    db = TinyDB('data.msg',storage=MsgPackStorage,Lib='umsgpack')\n    \n    def dbins():\n       db.insert({'type': 'apple', 'count': 7})\n    \n    dbins()\n\nAs you can see, it's a simple drop-in replacement for any storage engine\nand it can be nested and cached.\n\nWhy would I use this?\n=====================\nLooking at the statistics below, it's apparent that compared to the \"standard\"\nJSON Storage mechanism, MessagePack isn't as quick, however, the filesizes on\ndisc are smaller - consider the table below, with 1,000 JSON documents of \nminute size - clearly, the MessagePack compressed format is smaller than\nthe JSON format. Whether you choose the default MsgPack library, which is \nmarginally slower than the U-MsgPack library (at the cost of a small increase\nin storage footprint with U-MsgPack) is dependent on your use case.\n\n.. csv-table:: Timings (seconds)\n   :header: \"Format\",\"Run 1\", \"Run 2\", \"Run 3\", \"FileSize\"\n   :widths: 10,30, 30, 30,10 \n\n   \"JSON Write:\", 2.147,2.011,2.040,\"37.0 Kb\"\n   \"MsgPack Write:\", 9.562,9.732,9.716,\"21.1 Kb\"\n   \"U-MsgPack Write:\", 9.354,9.066,8.949,\"24.1 Kb\"\n\nChanges\n=======\n\n* Version 1.0.0-Beta5 - XX/XX/XXXX\n    * Added PiPy compatibility \n    * PEP-8 Compliant code style\n\n* Version 1.0.0-Beta4 - 11/26/2017\n    * Added descriptions of benchmarking and tidied up repo\n    * Further added information to README about usage\n\n* Version 1.0.0-Beta3 - 11/24/2017\n    * Added support for u-msgpack-python alternative msgpack library\n\n* Version 1.0.0-Beta2 - 11/21/2017\n    * Fixed Testing issues\n\n* Version 1.0.0-Beta - 11/19/2017\n    * Tidied up repo ready for Beta release\n\n* Version 0.2.0 - 11/18/2017\n    * Tidied up repo\n    * Added initial benchmarking and example\n    * Added Github Community files.\n\n* Version 0.1 - 11/13/2017\n    * Initial Release.\n\nReferences:\n===========\n\n* TinyDB      https://github.com/msiemens/tinydb \n* MessagePack https://msgpack.org/index.html\n* U-MsgPack   https://github.com/vsergeev/u-msgpack-python\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falshapton%2FTinyMP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falshapton%2FTinyMP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falshapton%2FTinyMP/lists"}