TheShed

OneDrive from Python

Category: Tools
#programming #python #onedrive

A nice commandline tool (based on a Python wrapper for the OneDrive REST API) for working with OneDrive.

pywin32 0. Setup a Python Virtual Environment 1. On Windows, install pywin32 . From the venv use easy_install http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download (with the path to the right pywin32 for your system and Python version...) 2. pip install pyyaml 3. pip install python-onedrive[standalone] 4. Register your app with the OneDrive service (to get the client and secret keys). MSDN details 5. Create a configuration file with the client ID and secret:

client:
  id: <client id here>
  secret: <secret key here>
  1. Auth dance onedrive-cli auth

Then use. For example onedrive-cli ls to list content stored in OneDrive.

Bonus thought

The OneDrive web service now has some basic Markdown support in the webage text editor, but http://dillinger.io/ is nice too ;-)