A SQLite implementation of the Python Shelf interface
Project description
sqlite-shelve
- Implements a shelve-like store in SQLite
- Applications incorporating this module can utilize the interfaces of SQLiteShelve class just like they do the Shelve class
- In most ordinary use cases, applications that use the builtin shelve module can switch to SQLiteShelve with the followng:
import sqliteshelve as shelve
d = shelve.open(filename) # opens existing SQLite3 database if it exists. Creates a new one if it does not
d[key] = data # store data at key (overwrites old data if
# using an existing key)
data = d[key] # retrieve a COPY of data at key (raise KeyError if no
# such key)
del d[key] # delete data stored at key (raises KeyError
# if no such key)
flag = d.has_key(key) # true if the key exists
klist = d.keys() # a list of all existing keys
d.close() #commits changes to Sqlite3 shelve store
- data, like in dbm, or BerkeleyDB-based storage libraries, is pickled with cpickle, but pickles with HIGHEST_PROTOCOL.
contains a script called shelve-tool, which is both a useful utility and provides an example for how sqlite-shelve can be used like the shelve module
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
sqlite-shelve-2.2.1.tar.gz
(6.7 kB
view details)
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 sqlite-shelve-2.2.1.tar.gz.
File metadata
- Download URL: sqlite-shelve-2.2.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49bfd073a014a0e89aa6c58567a347f33bec70d20397598c5fc5fb831ae8bd82
|
|
| MD5 |
94fc0a5c57ba44e302486a31a5702734
|
|
| BLAKE2b-256 |
6126e32ad260e6e5fe471844b95d89bce4f12d659378e44e80cc64372cfe9722
|
File details
Details for the file sqlite_shelve-2.2.1-py3-none-any.whl.
File metadata
- Download URL: sqlite_shelve-2.2.1-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c09e08139bc858d8970cd0325433da80b1ebf72706280096dbcfddf071c73ab9
|
|
| MD5 |
6bd2e27ba37476cb244d0706a3fbd30b
|
|
| BLAKE2b-256 |
fdede3c8ef8f8224828e419058e11b0a658e64c2c9784b5291fd4f29a6f6f1d8
|