the-collector


Namethe-collector JSON
Version 2023.8.26 PyPI version JSON
download
home_pagehttps://pypi.org/project/the-collector/
SummaryA library to store data in common formats
upload_time2023-08-27 04:29:37
maintainer
docs_urlNone
authorwalchko
requires_python>=3.10
licenseMIT
keywords library robotics robot storage json pickle gzip csv
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![image](https://raw.githubusercontent.com/MomsFriendlyRobotCompany/the-collector/master/pics/header.jpg)](https://github.com/MomsFriendlyRobotCompany/the-collector)

# The Collector

[![.github/workflows/python.yaml](https://github.com/MomsFriendlyRobotCompany/the_collector/actions/workflows/python.yaml/badge.svg)](https://github.com/MomsFriendlyRobotCompany/the_collector/actions/workflows/python.yaml)
![GitHub](https://img.shields.io/github/license/MomsFriendlyRobotCompany/the-collector)
[![Latest Version](https://img.shields.io/pypi/v/the-collector.svg)](https://pypi.python.org/pypi/the-collector/)
[![image](https://img.shields.io/pypi/pyversions/the-collector.svg)](https://pypi.python.org/pypi/the-collector)
[![image](https://img.shields.io/pypi/format/the-collector.svg)](https://pypi.python.org/pypi/the-collector)
![PyPI - Downloads](https://img.shields.io/pypi/dm/opencv_camera?color=aqua)

**This is still under heavy development**

This was written for a class I taught on robotics. It is meant to be simple and
teach the students some things. There are probably better solutions out there,
but I like this.

Read and write data files using pickle, json, gziped
json, and csv. Method is determined by filename extension.
Valid extensions are:

- .pkl: pickle
- .json: json
- .gzip: json compressed with gzip [default]
- .csv: comma separated values

## Usage

See the [notebook](docs/notebooks/the_collector.ipynb) for examples of how to use
it.

```python
from collector import Collector

c = Collector()
c.timestamp = False
d = np.array([[1,2,3],[4.,5.,6.]])
i = {"imu":
  {
    "gyro_range": 3000,
    "accel_range": 2
  }
}

c.write("test_test_now.csv",d)
dd = c.read("test_test_now.csv")

c.write("test_test_now.json",d,i)
dd = c.read("test_test_now.json")

fname = c.write("test_test_now.pkl",d,i)
dd = c.read(fname)

c.timestamp = True
fname = c.write("data/test_test_now.pkl",d,i)
dd = c.read(fname)
# Saving 2 data points in pickle to:
# --> data/2023-08-08_18:57:52_test_test_now.pkl
# Loaded 2 data points from:
# --> data/2023-08-08_18:57:52_test_test_now.pkl
```

# The MIT License (MIT)

Copyright (c) 2017 Kevin J. Walchko

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": "https://pypi.org/project/the-collector/",
    "name": "the-collector",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "library,robotics,robot,storage,json,pickle,gzip,csv",
    "author": "walchko",
    "author_email": "walchko@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/63/44/6a78b2fb46b8a8e18b4707a5da2ff0cd795272da7fc4bd160a5006fe8b01/the_collector-2023.8.26.tar.gz",
    "platform": null,
    "description": "[![image](https://raw.githubusercontent.com/MomsFriendlyRobotCompany/the-collector/master/pics/header.jpg)](https://github.com/MomsFriendlyRobotCompany/the-collector)\n\n# The Collector\n\n[![.github/workflows/python.yaml](https://github.com/MomsFriendlyRobotCompany/the_collector/actions/workflows/python.yaml/badge.svg)](https://github.com/MomsFriendlyRobotCompany/the_collector/actions/workflows/python.yaml)\n![GitHub](https://img.shields.io/github/license/MomsFriendlyRobotCompany/the-collector)\n[![Latest Version](https://img.shields.io/pypi/v/the-collector.svg)](https://pypi.python.org/pypi/the-collector/)\n[![image](https://img.shields.io/pypi/pyversions/the-collector.svg)](https://pypi.python.org/pypi/the-collector)\n[![image](https://img.shields.io/pypi/format/the-collector.svg)](https://pypi.python.org/pypi/the-collector)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/opencv_camera?color=aqua)\n\n**This is still under heavy development**\n\nThis was written for a class I taught on robotics. It is meant to be simple and\nteach the students some things. There are probably better solutions out there,\nbut I like this.\n\nRead and write data files using pickle, json, gziped\njson, and csv. Method is determined by filename extension.\nValid extensions are:\n\n- .pkl: pickle\n- .json: json\n- .gzip: json compressed with gzip [default]\n- .csv: comma separated values\n\n## Usage\n\nSee the [notebook](docs/notebooks/the_collector.ipynb) for examples of how to use\nit.\n\n```python\nfrom collector import Collector\n\nc = Collector()\nc.timestamp = False\nd = np.array([[1,2,3],[4.,5.,6.]])\ni = {\"imu\":\n  {\n    \"gyro_range\": 3000,\n    \"accel_range\": 2\n  }\n}\n\nc.write(\"test_test_now.csv\",d)\ndd = c.read(\"test_test_now.csv\")\n\nc.write(\"test_test_now.json\",d,i)\ndd = c.read(\"test_test_now.json\")\n\nfname = c.write(\"test_test_now.pkl\",d,i)\ndd = c.read(fname)\n\nc.timestamp = True\nfname = c.write(\"data/test_test_now.pkl\",d,i)\ndd = c.read(fname)\n# Saving 2 data points in pickle to:\n# --> data/2023-08-08_18:57:52_test_test_now.pkl\n# Loaded 2 data points from:\n# --> data/2023-08-08_18:57:52_test_test_now.pkl\n```\n\n# The MIT License (MIT)\n\nCopyright (c) 2017 Kevin J. Walchko\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library to store data in common formats",
    "version": "2023.8.26",
    "project_urls": {
        "Homepage": "https://pypi.org/project/the-collector/",
        "Repository": "http://github.com/MomsFriendlyRobotCompany/the_collector"
    },
    "split_keywords": [
        "library",
        "robotics",
        "robot",
        "storage",
        "json",
        "pickle",
        "gzip",
        "csv"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7114a01b3c9143913a9e6f19ec16b635b9fef8cf2ac8721c589af5d7d3824211",
                "md5": "4a6ade38f7e2850acb091cd3fa09ff22",
                "sha256": "d810b630502e592594075528891f930cc16fbe1b53434c3108b9776b5d198051"
            },
            "downloads": -1,
            "filename": "the_collector-2023.8.26-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4a6ade38f7e2850acb091cd3fa09ff22",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 8913,
            "upload_time": "2023-08-27T04:29:35",
            "upload_time_iso_8601": "2023-08-27T04:29:35.497459Z",
            "url": "https://files.pythonhosted.org/packages/71/14/a01b3c9143913a9e6f19ec16b635b9fef8cf2ac8721c589af5d7d3824211/the_collector-2023.8.26-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "63446a78b2fb46b8a8e18b4707a5da2ff0cd795272da7fc4bd160a5006fe8b01",
                "md5": "e5ee24a2a2d5ac93c1e6fce2ac39df44",
                "sha256": "7449569566530704f44de07471ee7c8984708fc534d01ceba6374ea00df4f881"
            },
            "downloads": -1,
            "filename": "the_collector-2023.8.26.tar.gz",
            "has_sig": false,
            "md5_digest": "e5ee24a2a2d5ac93c1e6fce2ac39df44",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 6290,
            "upload_time": "2023-08-27T04:29:37",
            "upload_time_iso_8601": "2023-08-27T04:29:37.038910Z",
            "url": "https://files.pythonhosted.org/packages/63/44/6a78b2fb46b8a8e18b4707a5da2ff0cd795272da7fc4bd160a5006fe8b01/the_collector-2023.8.26.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-27 04:29:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MomsFriendlyRobotCompany",
    "github_project": "the_collector",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "the-collector"
}
        
Elapsed time: 0.12265s