Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Deprecation Notice: this module uses obsolete API and wasn't
maintained for a while, use official
onedrive-sdk-python <https://github.com/OneDrive/onedrive-sdk-python>
__
module or something built on it instead.
Twisted-based python async interface for OneDrive API (version 5.0) <http://msdn.microsoft.com/en-us/library/live/hh826521>
__
(formerly known as SkyDrive).
API is mostly the same as in
python-onedrive <https://github.com/mk-fg/python-onedrive>
__ module
(txOneDriveAPI class maps to OneDriveAPIWrapper, txOneDrive to
OneDriveAPI) - methods are re-used directly from classes there, so more
info on these can be found in that project.
Key difference from synchronous python-onedrive module is that all methods return twisted Deferred objects as scheduled to run by event loop, allowing to run multiple operations (like large file uploads) concurrently within one python process.
Service was called SkyDrive prior to 2014-02-19, when it got renamed to OneDrive. This package similarly renamed from txskydrive to txonedrive.
Following script will print listing of the root OneDrive folder, upload "test.txt" file there, try to find it in updated folder listing and then remove it.
::
from twisted.internet import defer, reactor
from txonedrive.api_v5 import txOneDrivePersistent
@defer.inlineCallbacks
def do_stuff():
api = txOneDrivePersistent.from_conf()
# Print root directory ("me/skydrive") listing
print list(e['name'] for e in (yield api.listdir()))
# Upload "test.txt" file from local current directory
file_info = yield api.put('test.txt')
# Find just-uploaded "test.txt" file by name
file_id = yield api.resolve_path('test.txt')
# Check that id matches uploaded file
assert file_info['id'] == file_id
# Remove the file
yield api.delete(file_id)
do_stuff().addCallback(lambda ignored: reactor.stop())
reactor.run()
Note that txOneDriveAPIPersistent convenience class uses Microsoft
LiveConnect authentication data from "~/.lcrc" file, which must be
created as described in more detail in python-onedrive docs <https://github.com/mk-fg/python-onedrive#command-line-usage>
__.
In case you've missed Deprecation Notice at the start of this file:
onedrive-sdk-python <https://github.com/OneDrive/onedrive-sdk-python>
__
instead.It's a regular package for Python 2.7 (not 3.X).
Using pip <http://pip-installer.org/>
__ is the best way:
::
% pip install txonedrive
If you don't have it, use:
::
% easy_install pip
% pip install txonedrive
Alternatively (see also <http://www.pip-installer.org/en/latest/installing.html>
__):
::
% curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
% pip install txonedrive
Or, if you absolutely must:
::
% easy_install txonedrive
But, you really shouldn't do that.
Current-git version can be installed like this:
::
% pip install 'git+https://github.com/mk-fg/txonedrive.git#egg=txonedrive'
Note that to install stuff in system-wide PATH and site-packages,
elevated privileges are often required. Use "install --user",
~/.pydistutils.cfg <http://docs.python.org/install/index.html#distutils-configuration-files>
__
or virtualenv <http://pypi.python.org/pypi/virtualenv>
__ to do
unprivileged installs into custom paths.
Requirements
- `Python 2.7 (not 3.X) <http://python.org>`__
- `Twisted <http://twistedmatrix.com>`__ (core, web, at least 12.2.0)
- `python-onedrive <https://github.com/mk-fg/python-onedrive>`__
FAQs
Obsolete twisted-based python async interface for old MS OneDrive API
We found that txOneDrive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.