Skip to content

A python module for very basic APIs of the free dweet service.

License

Notifications You must be signed in to change notification settings

jacklinquan/micropython-basicdweet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

micropython-basicdweet

PayPal Donate PyPI version Downloads

A python module for very basic APIs of the free dweet service. Dweet is a simple machine-to-machine (M2M) service from dweet.io.

This module only supports these dweet APIs of the free dweet service:

  • dweet for
  • get latest dweet for
  • get dweets for

This module works under MicroPython and it is tested with MicroPython V1.18.

For a compatible CPython version, please find Python package basicdweet.

Installation

>>> import upip
>>> upip.install('micropython-basicdweet')

Alternatively just copy basicdweet.py to the MicroPython device.

Usage

>>> import basicdweet
>>> basicdweet.dweet_for('YOUR_THING', {'YOUR_DATA': 'YOUR_VALUE'})
{'content': {'YOUR_DATA': 'YOUR_VALUE'}, 'created': '2022-05-27T06:17:48.127Z', 'thing': 'YOUR_THING', 'transaction': '403dcd2b-99b9-44b4-b864-b682b898ac10'}
>>> basicdweet.get_latest_dweet_for('YOUR_THING')
[{'content': {'YOUR_DATA': 'YOUR_VALUE'}, 'created': '2022-05-27T06:17:48.127Z', 'thing': 'YOUR_THING'}]
>>> basicdweet.dweet_for('YOUR_THING', {'YOUR_DATA': 'YOUR_VALUE_2'})
{'content': {'YOUR_DATA': 'YOUR_VALUE_2'}, 'created': '2022-05-27T06:19:08.081Z', 'thing': 'YOUR_THING', 'transaction': '30cdc5b8-5da9-40ac-86a9-ea0df5ef8317'}
>>> basicdweet.get_latest_dweet_for('YOUR_THING')
[{'content': {'YOUR_DATA': 'YOUR_VALUE_2'}, 'created': '2022-05-27T06:19:08.081Z', 'thing': 'YOUR_THING'}]
>>> basicdweet.get_dweets_for('YOUR_THING')
[{'content': {'YOUR_DATA': 'YOUR_VALUE_2'}, 'created': '2022-05-27T06:19:08.081Z', 'thing': 'YOUR_THING'}, {'content': {'YOUR_DATA': 'YOUR_VALUE'}, 'created': '2022-05-27T06:17:48.127Z', 'thing': 'YOUR_THING'}]

About

A python module for very basic APIs of the free dweet service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages