{ "info": { "author": "Joel Stansbury", "author_email": "stansbury.joel@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Datastore\n### Currently supported file structures: CSV WAV JSON PICKLE\nPython module which loads and saves data structures based on the file extension.\n\n### Dependencies\n* Python3 (and native libraries)\n * json\n * csv\n * wave\n * struct\n * importlib\n * os\n * pickle\n\n\n### Installation\n`pip install loadsave`\n\n### Usage\n\n```\nimport loadsave\n\ndata = loadsave.load(filename)\n... manipulating data ...\nloadsave.save(data, filename)\n\n```\nSaving data can be a bit unintuitive.\n* `csv` requires data to be a list of dictionaries\n* `wav` requires data to be a tuple or list of the form `(y,sr)` exactly how it would be returned by `load('example.wav')`\n\n\n\n### Objective\nThis module attempts to follow a **generic procedure for reading and writing common data storage formats using only the file extension for guidance**.\n\nThe motivation here is as follows; Most of the time, the most generic approach to opening a file will work. It's may not be the most computationaly efficient way, but if loading time is not a bottleneck for your workflow, you might as well spend your time manipulating the data as opposed figuring out how to load it into python. The goal of Datastore is to make implementing these generic approaches as fast as possible. If it doesn't work, well at least you didn't waste much time. Otherwise, you just skipped a monotonous task and can get on with real work.\n\n\n\n\n### Example\n```\nimport loadsave\n\nd = [{'id': [1,2,3,4],'otherID':[4,3,2,1]}]\n\n# save this dict as a pickle\nloadsave.save(d, 'test.pkl')\n```\n`'test.pkl'` can be replaced with `'test.json'`, or `'test.csv'`. Attempting to save it to `'test.wav'` will return an error, because `d` is not an acceptable format for an audio waveform.\n\nHowever, if `d = [0,1,2,3,4]` you could call `loadsave.save((d,44100),'test.wav')`. `csv`s require a list of dictionaries, so trying to save _this_ as a csv will fail\n\n\n\n\n### File Types\n#### CSV\n* This is just a wrapper for csv.DictReader() / csv.DictWritter()\n* The data must be a list of dictionaries\n#### WAV\n* Restricted to 16-bit audio\n* Can handle stereo/multi-channel waveforms\n* Data must be a list or tuple of the form (waveform, samplerate), just like it is provided from `loadsave.load('example.wav')`\n#### PICKLE\n* This should work with any data structure in python.\n#### JSON\n* Can hanle `dict`, `list`, `str`, `int`, `float`, `bool`, and `None`\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/JoelStansbury/Datastore", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "loadsave", "package_url": "https://pypi.org/project/loadsave/", "platform": "", "project_url": "https://pypi.org/project/loadsave/", "project_urls": { "Homepage": "https://github.com/JoelStansbury/Datastore" }, "release_url": "https://pypi.org/project/loadsave/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "One-line loading and saving to/from various file formats (csv, wav, pkl, json)", "version": "0.0.3" }, "last_serial": 5737034, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "b567f02cf0333ac667ae1252f77ca429", "sha256": "9a14df63cbacf67b0aa3565ee660070ff445c2a092359263f22d84fda5479810" }, "downloads": -1, "filename": "loadsave-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b567f02cf0333ac667ae1252f77ca429", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4962, "upload_time": "2019-08-04T02:52:04", "url": "https://files.pythonhosted.org/packages/eb/41/8af1ac115ee71df39aa069701721e89c36083d2d86fe4ecdd56c9e52a662/loadsave-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7094ad3bb686ccc22f7e7523378ed4f9", "sha256": "2a59809f76be1e1ff4c42641f2f05bd4d871642aeaaca24be71cd088300a6fdb" }, "downloads": -1, "filename": "loadsave-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7094ad3bb686ccc22f7e7523378ed4f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3993, "upload_time": "2019-08-04T02:52:06", "url": "https://files.pythonhosted.org/packages/15/30/df8a30576e817dd71cef80da79e46339668db4d51125a710c8c347977922/loadsave-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "6646e288489c0400b688758d664ae228", "sha256": "abbe76ad2752742d51885e075e650db1872ae5f0ce46bbe6094aff07527e238d" }, "downloads": -1, "filename": "loadsave-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "6646e288489c0400b688758d664ae228", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4789, "upload_time": "2019-08-27T14:30:32", "url": "https://files.pythonhosted.org/packages/0e/dd/0b5b9a89842b912a74588d6572aeae1aec5b2e9bc15b86fcdc9f4fc613d1/loadsave-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f1948df2cd31958b1dd92f1910da5aa0", "sha256": "ff5f2e3d2cd3873d882ae95413121fc50cd20c403f2ac15399ff0daad5c9414f" }, "downloads": -1, "filename": "loadsave-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f1948df2cd31958b1dd92f1910da5aa0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3752, "upload_time": "2019-08-27T14:30:33", "url": "https://files.pythonhosted.org/packages/93/c6/3790a2ec832584d8b687dc3e2c07f6bfd2a2681d552ca474eac3078dd8ba/loadsave-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6646e288489c0400b688758d664ae228", "sha256": "abbe76ad2752742d51885e075e650db1872ae5f0ce46bbe6094aff07527e238d" }, "downloads": -1, "filename": "loadsave-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "6646e288489c0400b688758d664ae228", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4789, "upload_time": "2019-08-27T14:30:32", "url": "https://files.pythonhosted.org/packages/0e/dd/0b5b9a89842b912a74588d6572aeae1aec5b2e9bc15b86fcdc9f4fc613d1/loadsave-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f1948df2cd31958b1dd92f1910da5aa0", "sha256": "ff5f2e3d2cd3873d882ae95413121fc50cd20c403f2ac15399ff0daad5c9414f" }, "downloads": -1, "filename": "loadsave-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f1948df2cd31958b1dd92f1910da5aa0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3752, "upload_time": "2019-08-27T14:30:33", "url": "https://files.pythonhosted.org/packages/93/c6/3790a2ec832584d8b687dc3e2c07f6bfd2a2681d552ca474eac3078dd8ba/loadsave-0.0.3.tar.gz" } ] }