Coder Social home page Coder Social logo

dropbox-sdk-python's Introduction

Dropbox for Python

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

dropbox-sdk-python's People

Contributors

anishathalye avatar braincore avatar deckhubbot avatar dnlcrl avatar ewjoachim avatar fviard avatar greg-db avatar kratos83 avatar mbogosian avatar rianhunter avatar risforrob avatar starforever avatar steko avatar tivaliy avatar varenc avatar vinodc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.