{ "info": { "author": "Ouroboros Chrysopoeia", "author_email": "impredicative@users.nomail.github.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU Affero General Public License v3", "Programming Language :: Python :: 3.7", "Topic :: Communications :: File Sharing", "Topic :: Software Development :: Version Control :: Git", "Topic :: System :: Archiving", "Topic :: System :: Archiving :: Mirroring" ], "description": "# gitblobts\n\n`gitblobts` is an experimental Python package for **git-backed time-indexed blob storage**.\nEven so, a lock-in of the stored files with git is avoided.\nIf encryption is not enabled, a lock-in of the file contents with this application is also avoided.\n\nIts goal is to ensure availability of data both locally and remotely.\nIt stores each blob as a file in a preexisting local and remote git repository.\nEach filename contains an encoded nanosecond timestamp and format version number.\n\nGiven the pull and push actions of git, collaborative use of the same remote repo is supported.\nTo prevent merge conflicts, there is a one-to-many mapping of timestamp to filenames.\nThis is accomplished by including sufficient random bytes in the filename to ensure uniqueness.\n\nSubsequent retrieval of blobs is by a time range.\nAt this time there is no implemented method to remove or overwrite a blob; this is by design.\nFrom the perspective of the package, once a blob is written, it is considered read-only.\nAn attempt to add a blob with the same timestamp as a preexisting blob will result in a new blob.\n\nAn effort has been made to keep third-party package requirements to a minimum.\n\n## Links\n* Code: [https://github.com/impredicative/gitblobts/](https://github.com/impredicative/gitblobts/)\n* Docs: [https://gitblobts.readthedocs.io/](https://gitblobts.readthedocs.io/)\n* Release: [https://pypi.org/project/gitblobts/](https://pypi.org/project/gitblobts/)\n\n## Installation\nUsing Python 3.7+, install the package from PyPI: `pip install -U gitblobts`.\n\n## Usage examples\n\n### Storage\n```python\nfrom typing import Optional\nimport datetime, gitblobts, json, time, urllib.request\n\noptional_compression_module_name: Optional[str] = [None, 'bz2', 'gzip', 'lzma'][2]\noptional_user_saved_encryption_key: Optional[bytes] = [None, gitblobts.generate_key()][1]\nstore = gitblobts.Store('/path_to/preexisting_git_repo',\n compression=optional_compression_module_name, key=optional_user_saved_encryption_key)\n\nstore.addblob('a byte encoded string'.encode())\nstore.addblob(b'some bytes' * 1000, timestamp=time.time())\nstore.addblob(blob=json.dumps([0, 1., 2.2, 3]).encode(),\n timestamp=datetime.datetime.now(datetime.timezone.utc).timestamp())\nstore.addblob(blob=urllib.request.urlopen('https://i.imgur.com/3GmPd7O.png').read())\n\nstore.addblobs(blobs=[b'first blob', b'another blob'])\nstore.addblobs(blobs=[b'A', b'B'], timestamps=[time.time(), time.time()])\n```\n\n### Retrieval\n```python\nfrom typing import List\nfrom gitblobts import Blob, Store\nimport time\n\nstore = Store('/path_to/preexisting_git_repo', compression='gzip', key=b'JVGmuw3wRntCc7dcQHJ5q1noUs62ydR0Nw8HpyllKn8=')\n\nblobs: List[Blob] = list(store.getblobs(pull=False))\nblobs_bytes: List[bytes] = [b.blob for b in blobs]\ntimestamps: List[float] = [b.timestamp for b in blobs]\n\nblobs2_ascending: List[Blob] = list(store.getblobs(start_time='midnight yesterday', end_time='now'))\nblobs2_descending: List[Blob] = list(store.getblobs(start_time='now', end_time='midnight yesterday', pull=True))\nblobs3_ascending: List[Blob] = list(store.getblobs(start_time=time.time() - 86400, end_time=time.time(), pull=True))\nblobs3_descending: List[Blob] = list(store.getblobs(start_time=time.time(), end_time=time.time() - 86400))\n```\n\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/impredicative/gitblobts/", "keywords": "git bytes mirroring storage time", "license": "", "maintainer": "", "maintainer_email": "", "name": "gitblobts", "package_url": "https://pypi.org/project/gitblobts/", "platform": "", "project_url": "https://pypi.org/project/gitblobts/", "project_urls": { "Homepage": "https://github.com/impredicative/gitblobts/" }, "release_url": "https://pypi.org/project/gitblobts/0.0.7/", "requires_dist": [ "cryptography (>=2.4.2)", "dateparser (>=0.7.0)", "gitpython (>=2.1.11)" ], "requires_python": ">=3.7", "summary": "git-backed time-indexed blob storage", "version": "0.0.7" }, "last_serial": 4710416, "releases": { "0.0.7": [ { "comment_text": "", "digests": { "md5": "15b99092101afca3913f8ca80cb352e9", "sha256": "4daef8707264fc30cc07812df93ae4146ce46ab49b560ab57419e72057984f72" }, "downloads": -1, "filename": "gitblobts-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "15b99092101afca3913f8ca80cb352e9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 24395, "upload_time": "2019-01-18T01:19:05", "url": "https://files.pythonhosted.org/packages/8d/71/000769f7903060abae0971fd304b1ffab636e6622862eef3f8fac5011ee8/gitblobts-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1796b264c7c2b2d1b8b09203f0670e8d", "sha256": "39aea611f43bd6cb4176f10b8e2dac429d844c3c8593449b0e05d50e4c4eb7ed" }, "downloads": -1, "filename": "gitblobts-0.0.7.tar.gz", "has_sig": false, "md5_digest": "1796b264c7c2b2d1b8b09203f0670e8d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 12480, "upload_time": "2019-01-18T01:19:06", "url": "https://files.pythonhosted.org/packages/10/3c/bc670f5d98ece07229ddde7539a76033ccbd40dba8b57f4d01ceff5ad2fe/gitblobts-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "15b99092101afca3913f8ca80cb352e9", "sha256": "4daef8707264fc30cc07812df93ae4146ce46ab49b560ab57419e72057984f72" }, "downloads": -1, "filename": "gitblobts-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "15b99092101afca3913f8ca80cb352e9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 24395, "upload_time": "2019-01-18T01:19:05", "url": "https://files.pythonhosted.org/packages/8d/71/000769f7903060abae0971fd304b1ffab636e6622862eef3f8fac5011ee8/gitblobts-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1796b264c7c2b2d1b8b09203f0670e8d", "sha256": "39aea611f43bd6cb4176f10b8e2dac429d844c3c8593449b0e05d50e4c4eb7ed" }, "downloads": -1, "filename": "gitblobts-0.0.7.tar.gz", "has_sig": false, "md5_digest": "1796b264c7c2b2d1b8b09203f0670e8d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 12480, "upload_time": "2019-01-18T01:19:06", "url": "https://files.pythonhosted.org/packages/10/3c/bc670f5d98ece07229ddde7539a76033ccbd40dba8b57f4d01ceff5ad2fe/gitblobts-0.0.7.tar.gz" } ] }