How to Send and Receive Data from Cloud using Python
Ever heard of Thingspeak? That’s our cloud today.
Published in
4 min readApr 17, 2021
Have you ever wanted to store data (letter, word, sentence, paragraph, or even a full book) in a cloud and retrieve it at any point?
Here, I tell you the easiest way I discovered for the job. It just contains few lines of Python code.
What do you need?
- A Thingspeak account (If you don’t know it, no worries. Keep reading.)
- Python (Download it here)
- Python Editor (I use Geany. It’s light-weight and user-friendly)
I’ll first tell you how we’ll do it.
- We access Thingspeak from Python using its free API.
- We put data there.
- We retrieve it back again by downloading the history of all the data (CSV file)
That’s it!
Prerequisites:
After Python is installed
- Install
urllib
module: Open Command Prompt, typepip install urllib
, and press Enter. - Create your free Thingspeak account and channel.
- Make your channel public (So Python could access it).