Skip to main content

Official Dropbox API Client

Project description

https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v8.9.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.9.0.tar.gz (473.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dropbox-8.9.0-py3-none-any.whl (477.7 kB view details)

Uploaded Python 3

dropbox-8.9.0-py2-none-any.whl (477.7 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for dropbox-8.9.0.tar.gz
Algorithm Hash digest
SHA256 e7eeac47f35e73b34023b7a3089380e74bacd0cce4b57e1e347539dfb53681d2
MD5 77d6a3ec7a008e4f335e4f3b2beab74b
BLAKE2b-256 cb13c48ddfb470ac85b88a2f96f1a1764ca6587ff30bd0ac648b3efb9f825b77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dropbox-8.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fbfe84b9436eca37a78802508c0d7ce3200ad20e621ce73262edba6ae371ad3d
MD5 67f1016e509e647b7c2ccc6b9fd1601c
BLAKE2b-256 baffd5f30b7ced3d4a3c6602b2423e1b20cb91fa3362680a3d6f50b9e2af87b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dropbox-8.9.0-py2-none-any.whl
Algorithm Hash digest
SHA256 f14d1bc8a5ab293c4df04a690e54d503b1885acc246f6af4fe9207a22ed2f0eb
MD5 c729720b10fc6faf272a3da66a0b9a34
BLAKE2b-256 c897bd822c064cafd75967e3536fe7963c90308fcc692b0fc30f27b4fad18e55

See more details on using hashes here.

Supported by

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