{ "info": { "author": "Ragnar Lonn", "author_email": "hello@pushdata.io", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# Pushdata Python client library\n\nThis library allows you to easily store and retrieve time series data using the online service [pushdata.io](https://pushdata.io).\n\n## Installation\n\n`pip install pushdata-io`\n\n## Getting started\n\nYou can start storing data on [pushdata.io](https://pushdata.io) immediately, without even registering an account there. Just install this package and write three lines of code, like this:\n\n```python\nimport pushdata\n\npd = pushdata.Client(email=\"youremail@yourdomain.com\", tsname=\"MyTimeseries\")\npd.send(12345) # Stores the data point 12345, timestamped with the current date and time\n```\n\nAfter you've run the code and stored at least one data point, go to __https://pushdata.io/youremail@yourdomain.com__ where you will be able to view your timeseries.\n\n## Usage\n\n```python\nimport pushdata\n\n# 1. Initialize with no authentication\n# Initialize with our account email and time series name we want to use\npd = pushdata.Client(email=\"myemail@example.com\", tsname=\"mytimeseries\")\n\n# 2. ...or initialize with authentication (for account with security=on)\npd = pushdata.Client(apikey=\"thd8JT73LsB8jah0F4d9\", tsname=\"mytimeseries\")\n\n# Send a data point to the time series\npd.send(4711)\n\n# Send to another time series by overriding tsname\npd.send(4711, tsname=\"myothertimeseries\")\n\n# Retrieve all data from the time series\nresponse = pd.recv()\n\n# Or from another time series\nresponse = pd.recv(tsname=\"anothertimeseries\")\n\n# Retrieve data timestamped during the last week\nimport datetime\none_week_ago = datetime.datetime.now() - datetime.timedelta(days=7)\nresponse = pd.recv(fromtime=one_week_ago)\n\n# Retrieve data for one 24-hour period, one week ago\nimport datetime\none_week_ago = datetime.datetime.now() - datetime.timedelta(days=7)\none_week_ago_plus_24h = one_week_ago + datetime.timedelta(days=1)\nresponse = pd.recv(fromtime=one_week_ago, totime=one_week_ago_plus_24h)\n\n#\n# Print time series data\n#\n# We get a Python Requests response object from recv(), which \n# includes response code, raw HTTP response body, and more.\n# We use the .json() method to parse the body text as JSON\n# and get a dictionary:\ntsdata = response.json()\n#\n# And then we print stuff:\nprint(\"Timeseries name: \" + tsdata[\"name\"])\nprint(\"First point recorded at : \" + tsdata[\"first\"]) # timestamp of first point in time series\nprint(\"Last point recorded at : \" + tsdata[\"last\"]) # timestamp of last point in time series\nprint(\"Total number of points : \" + tsdata[\"total\"]) # total number of points in timeseries\nprint(\"Number of points returned : \" + tsdata[\"returned\"]) # number of points returned in this call\nprint(\"---- Points ----\")\nfor point in tsdata[\"points\"]:\n print(\"Time=%s value=%f\" % (point[\"time\"], point[\"value\"]))\n\n#\n# tsdata (the decoded JSON response from pushdata.io) is \n# a dictionary that looks like this:\n# {\n# \"name\": \"mytimeseries\",\n# \"first\": \"2019-02-15T07:43:31.546805Z\",\n# \"last\": \"2019-03-05T11:21:06.20951Z\",\n# \"total\": 482,\n# \"returned: 482,\n# \"offset\": 0,\n# \"limit\": 10000,\n# \"points\": [\n# {\n# \"time\": \"2019-02-15T07:43:31.546805Z\",\n# \"value\": 4711.0\n# },\n# ...\n# ]\n# }\n#\n# See https://speca.io/ragnarlonn/pushdata-io#TimeSeriesData\n#\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/pushdata-io/Python", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pushdata-io", "package_url": "https://pypi.org/project/pushdata-io/", "platform": "", "project_url": "https://pypi.org/project/pushdata-io/", "project_urls": { "Homepage": "https://github.com/pushdata-io/Python" }, "release_url": "https://pypi.org/project/pushdata-io/0.1.0/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "Python client library for pushdata.io", "version": "0.1.0" }, "last_serial": 4898912, "releases": { "0.0.9": [ { "comment_text": "", "digests": { "md5": "5fea2cbf17c4d71dc3a5b43a159e2f37", "sha256": "a69711d9a1e27993d7cecc0b5b432e6874dc0a06c823141b56ccbf222a86b08d" }, "downloads": -1, "filename": "pushdata_io-0.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "5fea2cbf17c4d71dc3a5b43a159e2f37", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3287, "upload_time": "2019-03-05T11:08:25", "url": "https://files.pythonhosted.org/packages/62/aa/db5142ce2ac02969f65b882de4a0f04b88540e7e6ec3127bb084ed4bd67f/pushdata_io-0.0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "759bad725718a02ce754d5cdfda9545f", "sha256": "1a9fc8fa8781c274a67e2fa2a8541a95a2bc1552e40f0afb19f4ef8ea95db0b9" }, "downloads": -1, "filename": "pushdata-io-0.0.9.tar.gz", "has_sig": false, "md5_digest": "759bad725718a02ce754d5cdfda9545f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2838, "upload_time": "2019-03-05T11:08:27", "url": "https://files.pythonhosted.org/packages/0a/a4/36dd48c6c2b326cc8cf68ce34bd2f08fc4bbc897a7440ef8c8b71102f360/pushdata-io-0.0.9.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "3bbafa1ae42aa702b4985dd2136b6a8d", "sha256": "e0a6be36bdfe0b53fc70e82224ff2e63a1b86f3dba0acb8b9a6adabb1e53381e" }, "downloads": -1, "filename": "pushdata_io-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3bbafa1ae42aa702b4985dd2136b6a8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3564, "upload_time": "2019-03-05T11:28:25", "url": "https://files.pythonhosted.org/packages/52/de/bc66ae500657a047edcae19ec8734b7cba4c9fa5e917b9b67dfe7f3c3404/pushdata_io-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db79f8b119cf98474888fa13df8e2068", "sha256": "b4b1f3fb117245dcd5532aa44c0551fe9c1ae934550a879ce88e76fdbbbae7f7" }, "downloads": -1, "filename": "pushdata-io-0.1.0.tar.gz", "has_sig": false, "md5_digest": "db79f8b119cf98474888fa13df8e2068", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3156, "upload_time": "2019-03-05T11:28:26", "url": "https://files.pythonhosted.org/packages/37/33/b941a1066bcdbde0bb2c11245d901d4c2da0de4ea420f4900ef8e794cd9a/pushdata-io-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3bbafa1ae42aa702b4985dd2136b6a8d", "sha256": "e0a6be36bdfe0b53fc70e82224ff2e63a1b86f3dba0acb8b9a6adabb1e53381e" }, "downloads": -1, "filename": "pushdata_io-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3bbafa1ae42aa702b4985dd2136b6a8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3564, "upload_time": "2019-03-05T11:28:25", "url": "https://files.pythonhosted.org/packages/52/de/bc66ae500657a047edcae19ec8734b7cba4c9fa5e917b9b67dfe7f3c3404/pushdata_io-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db79f8b119cf98474888fa13df8e2068", "sha256": "b4b1f3fb117245dcd5532aa44c0551fe9c1ae934550a879ce88e76fdbbbae7f7" }, "downloads": -1, "filename": "pushdata-io-0.1.0.tar.gz", "has_sig": false, "md5_digest": "db79f8b119cf98474888fa13df8e2068", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3156, "upload_time": "2019-03-05T11:28:26", "url": "https://files.pythonhosted.org/packages/37/33/b941a1066bcdbde0bb2c11245d901d4c2da0de4ea420f4900ef8e794cd9a/pushdata-io-0.1.0.tar.gz" } ] }