Git Product home page Git Product logo

dropme's Introduction

PyPI Build Status codecov Documentation Status

dropme

CLI tool to manage data in Dropbox workspace (based on official dropbox-sdk-python)

Quick Start

  1. Install dropme:

    • from GitHub (latest):

      • Clone dropme repository: git clone https://github.com/tivaliy/dropme.git.

      • Configure settings.yaml file (in dropme/settings.yaml).

        token: "YOUR_DROPBOX_ACCESS_TOKEN"

      • Create isolated Python environment virtualenv venv and activate it source venv/bin/activate.

      • Install dropme with all necessary dependencies: pip install -r requirements.txt .

    • from PyPI (stable)

      • Create isolated Python environment virtualenv venv and activate it source venv/bin/activate.
      • Install dropme with pip: pip install dropme
  2. Specify Dropbox access token (according to the search order):

    • as an argument of a command dropme ls -l --token YOUR_DROPBOX_ACCESS_TOKEN
    • as an environment variable export DBX_AUTH_TOKEN=YOUR_DROPBOX_ACCESS_TOKEN
    • in ~/.config/dropme/settings.yaml file
    • in dropme/settings.yaml file
  3. (Optional) Add dropme command bash completion:

    dropme complete | sudo tee /etc/bash_completion.d/gc.bash_completion > /dev/null

    Restart terminal and activate virtual environment once again.

  4. Run dropme:

    • as a standalone application

      $ dropme
      (dropme) whoami
      +--------------+------------------------+
      | Field        | Value                  |
      +--------------+------------------------+
      | user         | John Doe               |
      | e_mail       | [email protected]      |
      | country      | UA                     |
      | account_type | basic                  |
      +--------------+------------------------+
      (dropme) ls -l
      +------+---------+---------------------+-----------------------------+
      | type | size    | last_modified       | name                        |
      +------+---------+---------------------+-----------------------------+
      | d    |         |                     | demo/                       |
      | d    |         |                     | foo/                        |
      | d    |         |                     | dummy/                      |
      | -    | 1.11 MB | 2017-10-29 11:12:54 | Start work with Dropbox.pdf |
      | -    | 19.0 B  | 2017-11-17 12:41:29 | bar.txt                     |
      +------+---------+---------------------+-----------------------------+
    • as a command with respective sub-command arguments

      $ dropme df
      +-----------+-----------------+
      | Field     | Value           |
      +-----------+-----------------+
      | allocated | 2.0 GB          |
      | used      | 326.19 MB       |
      | available | 1.68 GB (84.1%) |
      +-----------+-----------------+

How to Use

usage: dropme [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug]
              [-t TOKEN]

CLI tool for managing Dropbox environment.

optional arguments:
  --version            show program's version number and exit
  -v, --verbose        Increase verbosity of output. Can be repeated.
  -q, --quiet          Suppress output except warnings and errors.
  --log-file LOG_FILE  Specify a file to log output. Disabled by default.
  -h, --help           Show help message and exit.
  --debug              Show tracebacks on errors.
  -t TOKEN, --token TOKEN
                       Dropbox access token.

Commands:
  complete       print bash completion command (cliff)
  cp             Copies a file or folder to a different location in the user’s Dropbox.
  df             Shows information about space usage of the current user's account.
  find           Searches for files and folders.
  get            Downloads a file at a given local path.
  help           print detailed help for another command (cliff)
  ls             Lists directory content.
  mkdir          Creates a folder at a given path.
  mv             Moves a file or folder to a different location in the user’s Dropbox.
  put            Uploads a file to a specified directory.
  restore        Restores file to a specified revision.
  revs           Lists file revisions.
  rm             Deletes a file or a folder at a given path.
  status         Shows status of a specified file or folder.
  whoami         Shows information about the current user's account.

Running the tests

We use the tox package to run tests. To install, use pip install tox. Once installed, run tox from the root directory.

Links

dropme's People

Contributors

tivaliy avatar

Stargazers

 avatar

Watchers

 avatar  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.