Skip to main content

Official Dropbox API Client

Project description

https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v9.5.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-9.5.0.tar.gz (612.6 kB view details)

Uploaded Source

Built Distributions

dropbox-9.5.0-py3-none-any.whl (624.1 kB view details)

Uploaded Python 3

dropbox-9.5.0-py2-none-any.whl (624.1 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: dropbox-9.5.0.tar.gz
  • Upload date:
  • Size: 612.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for dropbox-9.5.0.tar.gz
Algorithm Hash digest
SHA256 118a0c376cb9e7db63b2dbf560ba5c966cf1f0bfef7b67d4842ce123c383e947
MD5 ef51aae4485237cb67a2e23d67ac9e60
BLAKE2b-256 206ce48d2ee92514240ce8b779985f108cad3833f2ef7a1b004af575e279220e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: dropbox-9.5.0-py3-none-any.whl
  • Upload date:
  • Size: 624.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for dropbox-9.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55b06eabcea1d52774d68f9d2bf9922f58bad92ba23db04c9add8b6ae8548498
MD5 20849b40c4c9cb8efc10bc3e7919011d
BLAKE2b-256 5aff22a932f14bd4272146df576f219d2687976164833820ab2400fe1b56db7d

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: dropbox-9.5.0-py2-none-any.whl
  • Upload date:
  • Size: 624.1 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for dropbox-9.5.0-py2-none-any.whl
Algorithm Hash digest
SHA256 0a65a0296b0288479741d341e62668774d2ef2eb139e47c3202da5f29a0221c9
MD5 91b3d169fee2ed982befa3efa29a528b
BLAKE2b-256 bd7c372a9303412daad6a23da4ca7f0dbade4427158d6a2bf901bab3ae0ff2bb

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