Name | sensoterra JSON |
Version |
2.0.1
JSON |
| download |
home_page | None |
Summary | Query Sensoterra probes using the Customer API |
upload_time | 2024-07-08 19:35:15 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | None |
keywords |
sensoterra
soil moisture
probe
sensor
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Sensoterra
Package to retrieve Sensoterra probe data by polling the Sensoterra Customer API using async/await.
## Example code
When the email and password are always available:
```python
import time
import asyncio
from sensoterra.customerapi import CustomerApi
async def main(email, password):
api = CustomerApi(email, password)
api.set_language("en")
while True:
api.poll()
for probe in api.probes():
print(probe)
for sensor in probe.sensors():
print(sensor)
print()
time.sleep(900)
print('-' * 70)
asyncio.run(main("me@example.com", "secret"))
```
Otherwise request a authentication token:
```python
from datetime import datetime
async def get_token(email, password):
api = CustomerApi(email, password)
api.set_language("en")
tag = "My Application"
scope = "READONLY"
expiration = datetime(2038, 1, 1, 0, 0)
token = await api.get_token(tag, scope, expiration)
```
And use this token:
```python
async def main(email, password):
token = await get_token(email, password)
api = CustomerApi()
api.set_language("en")
api.set_token(token)
while True:
probes = await api.poll()
for probe in probes:
print(probe)
for sensor in probe.sensors():
print(sensor)
print()
time.sleep(900)
print('-' * 70)
```
## Changelog
[CHANGELOG](CHANGELOG.md)
Raw data
{
"_id": null,
"home_page": null,
"name": "sensoterra",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "Sensoterra, soil moisture, probe, sensor",
"author": null,
"author_email": "Mark Ruys <mark.ruys@sensoterra.com>",
"download_url": "https://files.pythonhosted.org/packages/7b/86/a62eb7206173faca0974dc1f195b2400b49b5d0f0bf4141541c8b4189086/sensoterra-2.0.1.tar.gz",
"platform": null,
"description": "# Sensoterra\n\nPackage to retrieve Sensoterra probe data by polling the Sensoterra Customer API using async/await.\n\n## Example code\n\nWhen the email and password are always available:\n\n```python\nimport time\nimport asyncio\n\nfrom sensoterra.customerapi import CustomerApi\n\nasync def main(email, password):\n api = CustomerApi(email, password)\n api.set_language(\"en\")\n\n while True:\n api.poll()\n\n for probe in api.probes():\n print(probe)\n for sensor in probe.sensors():\n print(sensor)\n print()\n\n time.sleep(900)\n print('-' * 70)\n\nasyncio.run(main(\"me@example.com\", \"secret\"))\n```\n\nOtherwise request a authentication token:\n\n```python\nfrom datetime import datetime\n\nasync def get_token(email, password):\n api = CustomerApi(email, password)\n api.set_language(\"en\")\n\n tag = \"My Application\"\n scope = \"READONLY\"\n expiration = datetime(2038, 1, 1, 0, 0)\n token = await api.get_token(tag, scope, expiration)\n```\nAnd use this token:\n```python\nasync def main(email, password):\n token = await get_token(email, password)\n\n api = CustomerApi()\n api.set_language(\"en\")\n api.set_token(token)\n\n while True:\n probes = await api.poll()\n\n for probe in probes:\n print(probe)\n for sensor in probe.sensors():\n print(sensor)\n print()\n\n time.sleep(900)\n print('-' * 70)\n```\n\n## Changelog\n\n[CHANGELOG](CHANGELOG.md)\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Query Sensoterra probes using the Customer API",
"version": "2.0.1",
"project_urls": {
"Changelog": "https://gitlab.com/sensoterra/public/python/-/blob/main/CHANGELOG.md",
"Homepage": "https://gitlab.com/sensoterra/public/python",
"Issues": "https://gitlab.com/sensoterra/public/python/-/issues",
"Repository": "https://gitlab.com/sensoterra/public/python.git"
},
"split_keywords": [
"sensoterra",
" soil moisture",
" probe",
" sensor"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "340df3b2c3af973860ad0bcb74040dde8e7e38e8740c7ecba7e7f2c462ca14f9",
"md5": "f99e36060d7a6ab39d3e83a29eaaa0e6",
"sha256": "b25e6a9276e1f7e71efeed41c91e326e832bb021b5d2c0532fee6dbda5c73120"
},
"downloads": -1,
"filename": "sensoterra-2.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f99e36060d7a6ab39d3e83a29eaaa0e6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 6413,
"upload_time": "2024-07-08T19:35:11",
"upload_time_iso_8601": "2024-07-08T19:35:11.986926Z",
"url": "https://files.pythonhosted.org/packages/34/0d/f3b2c3af973860ad0bcb74040dde8e7e38e8740c7ecba7e7f2c462ca14f9/sensoterra-2.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7b86a62eb7206173faca0974dc1f195b2400b49b5d0f0bf4141541c8b4189086",
"md5": "33af1024e581f027af9382a01a06904e",
"sha256": "59f8d33a7b3938f53cfae7c37857431a351184159415fc3fa9148741acc12f4e"
},
"downloads": -1,
"filename": "sensoterra-2.0.1.tar.gz",
"has_sig": false,
"md5_digest": "33af1024e581f027af9382a01a06904e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 7083,
"upload_time": "2024-07-08T19:35:15",
"upload_time_iso_8601": "2024-07-08T19:35:15.063239Z",
"url": "https://files.pythonhosted.org/packages/7b/86/a62eb7206173faca0974dc1f195b2400b49b5d0f0bf4141541c8b4189086/sensoterra-2.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-08 19:35:15",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "sensoterra",
"gitlab_project": "public",
"lcname": "sensoterra"
}