Safecast API Python Wrapper

34 views
Skip to first unread message

Yoan Tournade

unread,
Mar 31, 2016, 6:05:21 AM3/31/16
to Safecast Device Discussions and Support
Hello Safecasters,

For all those that use scripts to publish their data they may find useful that Python library that wraps the Safecast API.

That's how you publish a bGeigie dataset file with it:

import SafecastPy
safecast = SafecastPy.SafecastPy(api_key='YOUR_API_KEY')
bgeigie_import = safecast.upload_bgeigie_import(files={ 'bgeigie_import[source]': open('misc/sample_bgeigie.LOG', 'rb') }, data={ 'bgeigie_import[name]': 'Logging in Compiègne', 'bgeigie_import[description]': 'Around the Université de Technologie', 'bgeigie_import[credits]': 'by YtoTech team', 'bgeigie_import[cities]': 'Compiègne', 'bgeigie_import[orientation]': 'NWE', 'bgeigie_import[height]': '100' }) print('New import id: {0}'.format(bgeigie_import['id']))


You can also use the library to grab some data from the Safecast API.

If it miss something or if there is a bug tell me at yo...@ytotech.com.

Happy hacking!

johan carlsson

unread,
May 8, 2016, 10:58:42 AM5/8/16
to Safecast Device Discussions and Support
Ohhh, my... Just what I was looking for. 
If (when) any questions occur, I'll contact you :D 

Yoan Tournade

unread,
May 8, 2016, 2:22:58 PM5/8/16
to Safecast Device Discussions and Support
Cool! Feel free to reach out :)
Reply all
Reply to author
Forward
0 new messages