GET and PUT file to your Dropbox
pip3 install --upgrade git+https://github.com/mnogom/dropit.git
- From command line
% dropit --help
usage: dropit [-h] {put,get,logout} ...
Get/Put file from/to Dropbox
positional arguments:
{put,get,logout}
put Put local file to Dropbox
get Get file from Dropbox to local storage
logout Remove all user tokens
optional arguments:
-h, --help show this help message and exit
% dropit put --help
usage: dropit put [-h] [-f] [-s] src_path dest_path
Put local file to Dropbox
positional arguments:
src_path Source file path
dest_path Destination file path
optional arguments:
-h, --help show this help message and exit
-f, --force force update file (rewrite file if it already exists)
-s, --share get url for file from Dropbox. Be careful. File would be visible for everyone
% dropit get --help
usage: dropit get [-h] [-f] src_path dest_path
Get file from Dropbox to local storage
positional arguments:
src_path Source file path
dest_path Destination file path
optional arguments:
-h, --help show this help message and exit
-f, --force force update file (rewrite file if it already exists)
% dropit logout --help
usage: dropit logout [-h]
Remove all user tokens
optional arguments:
-h, --help show this help message and exit
- From python
import dropit
# Put file to Dropbox
dropit.put_file("local/file/path", "dropbox/file/path", force=True)
# Get file from Dropbox
dropit.get_file("dropbox/file/path", "local/file/path")
# Remove all tokens from cache
dropit.logout_app()
- Copy repository
- clone repository from github
git clone git@github.com:mnogom/dropit.git
- go to project directory
cd dropit
- setup env. Uses poetry. Be sure you have it.
pip install --upgrade poetry --user
make install
- to check virtural env
poetry env list --full-path
~/<path>/<to>/<project>/dropit/.venv (Activated)
- to be sure that all works try to start tests. Tests will work after first run script.
make test
tests/test_drop.py::test_drops[text.txt] PASSED [ 25%]
tests/test_drop.py::test_drops[flower.jpg] PASSED [ 50%]
tests/test_drop.py::test_drops[task.jpg] PASSED [ 75%]
tests/test_drop.py::test_app_check PASSED [100%]
- Validate and auto-update token
- Can get a file from Dropbox
- Can put a file to Dropbox
- Can use force (overwrite a local file or in Dropbox)
- Can share an uploaded file. Url will be in console and your clipboard
- Check extensions of files
- Remove all user tokens. This is only one method to protect you Dropbox account
- At first launch you will need to create access_token. It will be saved in home_directory/.dropit_cache/.user_tok ens.json in unencrypted format. Don't forget to logout [6] if you want to protect your account
- If you put the file that already exists you will have an error. But you can use -f / --force flag to rewrite file
- Util check extensions of files
- Put and share file to the World
- Get file from Dropbox
- Logout