Skip to main content

Official Dropbox API Client

Project description

https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.2.0 [Latest Release Documentation] [Latest Release Version] [Latest Release License] [Latest Release Supported Python Versions] [Latest Release Supported Python Implementations] [Latest Release Development Stage]

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

dropbox-8.2.0.tar.gz (415.2 kB view details)

Uploaded Source

Built Distributions

dropbox-8.2.0-py3-none-any.whl (425.0 kB view details)

Uploaded Python 3

dropbox-8.2.0-py2-none-any.whl (425.0 kB view details)

Uploaded Python 2

File details

Details for the file dropbox-8.2.0.tar.gz.

File metadata

  • Download URL: dropbox-8.2.0.tar.gz
  • Upload date:
  • Size: 415.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dropbox-8.2.0.tar.gz
Algorithm Hash digest
SHA256 661b0a16a4188aebc4effd901a22eedc75df795cb37e0cbabde397bda068cd90
MD5 b0ef9a8e5b9c67662e43f8a273578082
BLAKE2b-256 30aed7a8ecf3070e6d1ba87b6b60a5548a641624ea6cc8f0084a24893aa705ea

See more details on using hashes here.

Provenance

File details

Details for the file dropbox-8.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dropbox-8.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bdf7b86d71cd48dd95105a7f9cc0f655a56ed07f8a883a17bb7c36d1c1217068
MD5 cb17d98a976d267793381910b9f20ee0
BLAKE2b-256 0a32b0cbb8b912d27b3d13b8c006894630087b5108b1ebe47b78fe66eee9b75f

See more details on using hashes here.

Provenance

File details

Details for the file dropbox-8.2.0-py2-none-any.whl.

File metadata

File hashes

Hashes for dropbox-8.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 34a4b67b281fb2f2643e8e943397cda73749e9b4f0a418c93b06555082b2c3d3
MD5 4fbf856945bb39cc64f13a425e2e95d2
BLAKE2b-256 752723df0483f598a37feee30e72290583ca3f5c00a29f86d86f0ca376d2579c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page