Official Dropbox API Client
Project description
A Python SDK for integrating with the Dropbox API v2. Compatible with Python 2.7 and 3.4+. Documentation is available on Read the Docs.
Installation
Install via pip:
$ pip install dropbox
Install from source:
$ git clone git://github.com/dropbox/dropbox-sdk-python.git
$ cd dropbox-sdk-python
$ python setup.py install
After installation, to get started, open a Python console:
>>> import dropbox
>>> dbx = dropbox.Dropbox("YOUR_ACCESS_TOKEN")
>>> dbx.users_get_current_account()
Creating an Application
You need to create an Dropbox Application to make API requests.
Obtaining an Access Token
All requests need to be made with an OAuth 2 access token. To get started, once you’ve created an app, you can go to the app’s console and generate an access token for your own Dropbox account.
Examples
example/updown.py demonstrates how to sync a local directory with a Dropbox.
Documentation
Documentation can be compiled by running make html from the docs folder. After compilation, open docs/_build/html/index.html. Alternatively, you can read a hosted version from Read the Docs.
Updating API specification
A good amount of this SDK is generated using Stone. We use git submodules to pin to a specific version of Stone since it’s under active development, and we also pin to a version of our API spec.
To prepare the repo for generation, run these commands after cloning:
$ git submodule init
$ git submodule update
You can run git pull within these sub repositories to update the pinned version.
Now, run the included script:
$ ./generate_base_client.py
Testing
We use the tox package to run tests in Python
2 and 3. To install, use pip install tox
. Once installed, run tox from the
root directory. You’ll need to specify a working Dropbox OAuth2 token:
$ DROPBOX_TOKEN=YOUR_TOKEN tox -- -k "'not test_team'"
Note that we skip test_team which requires a team token with Member File Access. To test this functionality, specify a DROPBOX_TEAM_TOKEN environment variable.
$ DROPBOX_TOKEN=... DROPBOX_TEAM_TOKEN=... tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file dropbox-8.8.1.tar.gz
.
File metadata
- Download URL: dropbox-8.8.1.tar.gz
- Upload date:
- Size: 466.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c115ac5aa17a5bf43172617d992c89615e6639a6533e9b4cb8b8f26c69220a9 |
|
MD5 | bba2fdd10bc7ebf38d465e50aa081e0f |
|
BLAKE2b-256 | 44c2567867bb3f62e80f363af6fdcc5dfe3a057dad950d262d2867f173a2b878 |
Provenance
File details
Details for the file dropbox-8.8.1-py3-none-any.whl
.
File metadata
- Download URL: dropbox-8.8.1-py3-none-any.whl
- Upload date:
- Size: 472.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49f52a02af4127ed19c31a7c8ecaeaf505d97b1444ca880a9afc2c2561d020f8 |
|
MD5 | db4c4372c5580cfcadfa122481481340 |
|
BLAKE2b-256 | a4d2890b3e6ab8558361107961c3cdd58bc889dd21cafa4c4f89d20d2ec800cd |
Provenance
File details
Details for the file dropbox-8.8.1-py2-none-any.whl
.
File metadata
- Download URL: dropbox-8.8.1-py2-none-any.whl
- Upload date:
- Size: 472.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df24cf229967830d505f8c9c48f90c8ab96322ae04a3da1a56ebba7ffe2e3295 |
|
MD5 | f0a90a6a7353fbeb2d1c5ab4aecbcd57 |
|
BLAKE2b-256 | d4f218af069c11e94c483cd6f643f9d7e8f35d285dc40190550f7e16c34ce4b2 |