A python library to interrogate emoncms API
Project description
pyemoncms
python library for emoncms API
rely on aiohttp
to install : pip3 install pyemoncms
how to use :
import logging
import asyncio
from pyemoncms import EmoncmsClient
key = "your32bitsAPIkey"
url = "http://url:8081"
client = EmoncmsClient(url, key, request_timeout=1)
client.logger.setLevel("DEBUG")
async def get_path(path):
print(await client.async_request(path))
async def list_feeds():
print(await client.async_list_feeds())
async def get_feed_fields(feed_id):
print(await client.async_get_feed_fields(feed_id))
loop = asyncio.get_event_loop()
loop.create_task(get_path("/feed/list.json"))
loop.create_task(get_path("/user/getuuid.json"))
loop.create_task(list_feeds())
loop.create_task(get_feed_fields(1))
loop.run_forever()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyemoncms-0.0.5.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for pyemoncms-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5090c0c49276e3bd7938333aca665402b5de8acc52e4339e67eb2cdf89ac964d |
|
MD5 | f6c3530a872fa17dc7255c2d3db35a71 |
|
BLAKE2b-256 | d6a81b4c988cfa777a2e215406054b1d6ec59cd6f384d1211799ea29cbe0b307 |