Skip to main content

Official Dropbox API Client

Project description

https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v7.2.1 [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

Upgrading from v1

To ease the transition to the new API and SDK, you can still use the old dropbox.client.DropboxClient class. In fact, v2 and v1 can be used simultaneously. Support for the old client will be dropped once the new SDK is at functional parity.

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

If you only want to test the API v2 client, use:

$ DROPBOX_TOKEN=... DROPBOX_TEAM_TOKEN=... tox -- -k TestDropbox

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-7.2.1.tar.gz (298.2 kB view details)

Uploaded Source

Built Distributions

dropbox-7.2.1-py3-none-any.whl (302.4 kB view details)

Uploaded Python 3

dropbox-7.2.1-py2-none-any.whl (302.4 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for dropbox-7.2.1.tar.gz
Algorithm Hash digest
SHA256 acb85a33b4f977de11facb7516b4e0c9d5325920e71a2a26d39df383d34fefec
MD5 6ca8a76c66a9bbb8689cd77b88c09b60
BLAKE2b-256 39895e494728d66645cefa5ef21ac104fc0be12e512fe623e5c37bac1243fb88

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for dropbox-7.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4206b2fe239eb2cf7ed30e2425e0d41800f3207b34dfcf949164ed42b40cc81f
MD5 894c3fdaf3ebc4de272e04b7ff9679a5
BLAKE2b-256 ec998a4ebb3a58ff23f5ab328d188c17a58f3a12440b2b6a4345a0ec6f438f68

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for dropbox-7.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 34fe06b735358f4454d59e2ea3dadff63fa03e0763b7fbd45a55d31b0384bc7d
MD5 72eeaf884128dcfe15eec57d7bb9cca1
BLAKE2b-256 ed1b255c2e9dfcba789cd48f0dd8c3d4f093b8b0bac1dbe438999f8ddaf40ea7

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