pydrive (googledrive) with a simple (dict-like or list-like) interface
Project description
pydrivedol
pydrive (googledrive) with a simple (dict-like or list-like) interface
To install: pip install pydrivedol
A basic Google Drive persister implemented with the pydrive library. Keys must be names of files.
**** Authentication *** Drive API requires OAuth2.0 for authentication.
- Go to APIs Console (https://console.cloud.google.com/cloud-resource-manager) and make your own project.
- Search for ‘Google Drive API’, select the entry, and click ‘Enable’.
- Select ‘Credentials’ from the left menu, click ‘Create Credentials’, select ‘OAuth client ID’.
- Now, the product name and consent screen need to be set -> click ‘Configure consent screen’ and follow the instructions.
Once finished:
- Select ‘Application type’ to be Web application.
- Enter an appropriate name.
- Input http://localhost:8080 for ‘Authorized JavaScript origins’.
- Input http://localhost:8080/ for ‘Authorized redirect URIs’.
- Click ‘Save’.
- Click ‘Download JSON’ on the right side of Client ID to download client_secret_.json. see: https://pythonhosted.org/PyDrive/quickstart.html for details.
- Rename the file to “client_secrets.json” and place it in your working directory.
>>> from pydrive import GoogleDrivePersister
>>> s = GoogleDrivePersister()
>>> k = 'foo'
>>> v = 'bar'
>>> for _key in s:
... del s[_key]
>>> len(s)
0
>>> s[k] = v
>>> s[k]
'bar'
>>> s.get(k)
'bar'
>>> len(s)
1
>>> list(s.values())
['bar']
>>> k in s
True
>>> del s[k]
>>> k in s
False
>>> len(s)
0
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydrivedol-0.0.2.tar.gz.
File metadata
- Download URL: pydrivedol-0.0.2.tar.gz
- Upload date:
- Size: 3.0 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 |
c526ddd0544e907223b52313788bcd547989c775a1de392bec1dd6479e027a8f
|
|
| MD5 |
a09372193e73752c45cd230481cbc02a
|
|
| BLAKE2b-256 |
c3f15f9b630c89540402251428863ee14471c025914a9b309bab4942a30e4a8b
|
File details
Details for the file pydrivedol-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pydrivedol-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.7 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 |
fd0d83973f5acedcc48533aa9d3c456f3f761d621a68e543b550e66cde6f00da
|
|
| MD5 |
c1aa6187426b49e3ede3f6ef195bb6e3
|
|
| BLAKE2b-256 |
2bafc53c09bc476a659eeeec9690d1edc87d18279e1906136956c24bb45311e2
|