# Save data in a file with Python API

**URL:** <https://www.thethingsnetwork.org/forum/t/save-data-in-a-file-with-python-api/37433>\
**Category:** Uncategorized\
**Created:** [May 29, 2020, 12:31pm UTC](https://www.thethingsnetwork.org/forum/t/save-data-in-a-file-with-python-api/37433 "2020-05-29T12:31:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [May 29, 2020, 1:32pm UTC](https://www.thethingsnetwork.org/forum/t/save-data-in-a-file-with-python-api/37433/2 "2020-05-29T13:32:18Z")

</div>

The TTN implementation has been left behind / deprecated.

[paho-mqtt · PyPI](https://pypi.org/project/paho-mqtt/) seems to be the client of choice now.

> [@A Python program to listen to your devices with MQTT](https://www.thethingsnetwork.org/forum/t/a-python-program-to-listen-to-your-devices-with-mqtt/9036):
>
> A python program to listen to your devices with mqttn with credentials I will upload a Spark version when ready. # node.py # Simple Python client to show node activity from ttn MQTT brooker with credentials # Author: R.Schimmel # www.schimmel-bisolutions.nl # first install paho.mqtt.client: pip install paho-mqtt # import paho.mqtt.client as mqtt #Call back functions # gives connection message def on\_connect(client,userdata,rc): print("Connected with result code:"+str(rc)) # subscri…

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/save-data-in-a-file-with-python-api/37433)._
