Best way to access cloud-based text file in Pythonista

I track my household water meter weekly to help identify significant usage. My current workflow involves using Drafts on my iPhone/Apple Watch to record the current water meter reading and date, and then to append that to a markdown table in a text file on Dropbox. I then switch over to my Mac, where I parse that Dropbox text file using Python to calculate the daily water usage rate and output a time series if wanted.

I’d like to do this completely on an iOS device. While I’m sure that Pythonista has the ability to run the code to perform the usage rate calculations, I haven’t figured out how to enable Pythonista to access files on Dropbox. Does Pythonista have the capability to access .csv files on either Dropbox or iCloud Drive without getting into complex authorization token handling?

Thanks to Rosemary and David for a great podcast and forum.

Craig

I believe you would need an API token to deal with Dropbox, but that isn’t overly onerous.

If you want the technical documentation then I think that you want to take a look at:

But, if you want a shortcut, maybe try the Synchronator (a Python module to synchronize files between iOS device and Dropbox : Pythonista | Python 3.

In regards to iCloud, check out this post on the Pythonista forum - Save to arbitrary iCloud Drive path in new Pythonista?.

Note that iCloud is in the latest version of Pythonista.

Hope that helps.

Alternatively if your python will run in Editorial, it has native Dropbox support.

Thank you for your responses. I’ll give Editorial a shot, then will fall back to iCloud on Pythonista if that doesn’t work.

Craig

I was able to get things started using the Python features of Editorial to read a Dropbox file. I then realized that my python code uses the pandas module, which Pythonista and Editorial don’t support.

Under the assumption that I would be wirelessly connected to my house LAN, I switched over to using the Prompt 2 iOS app to ssh into a local Linux box to run python from the command line.

Thanks again for all of the suggestions.