dropbox with a simple (dict-like or list-like) interface
Project description
dropboxdol
dropbox with a simple (dict-like or list-like) interface
To install: pip install dropboxdol
A persister for dropbox.
You need to have the python connector (if you don't: pip install dropbox) You also need to have a token for your dropbox app. If you don't it's a google away. Finally, for the test below, you need to put this token in ~/.py2store_configs.json' under key dropbox.__init__kwargs, and have a folder named /py2store_data/test/ in your app space.
>>> import json
>>> import os
>>> from dropboxdol import DropboxPersister
>>> configs = json.load(open(os.path.expanduser('~/.py2store_configs.json')))
>>> s = DropboxPersister('/py2store_data/test/', **configs['dropbox']['__init__kwargs'])
>>> if '/py2store_data/test/_can_remove' in s:
... del s['/py2store_data/test/_can_remove']
...
>>>
>>> n = len(s)
>>> if n == 1:
... assert list(s) == ['/py2store_data/test/_can_remove']
...
>>> s['/py2store_data/test/_can_remove'] = b'this is a test'
>>> assert len(s) == n + 1
>>> assert s['/py2store_data/test/_can_remove'] == b'this is a test'
>>> '/py2store_data/test/_can_remove' in s
True
>>> del s['/py2store_data/test/_can_remove']
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
dropboxdol-0.0.3.tar.gz
(4.4 kB
view details)
Built Distribution
File details
Details for the file dropboxdol-0.0.3.tar.gz
.
File metadata
- Download URL: dropboxdol-0.0.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9c9d9397379fd44e3f35d905339f0dc05550a0337910e7469bba24afc7614aa |
|
MD5 | 7500698128c4bb3e9818280bee369687 |
|
BLAKE2b-256 | 380ffa1a96f51749057bb99b8fba720ca1a4993a6b8498affcdcd56c0b0fda43 |
File details
Details for the file dropboxdol-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: dropboxdol-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 746d4aec8c6bb4b408b72a82b51e04b5684e919f4f9d3b16ba45f85f1457004e |
|
MD5 | 1afcacfb174fd9c64c7c63bcda3a12ab |
|
BLAKE2b-256 | f9c570943a5bdcbb537db40c2d8f449d3f713a4d616a31cf756b8b1a66577f7c |