A simple key/value store with multiple backends.
Project description
🥫 Preserve - A simple Python Key/Value database with multiple backends.
⚠️ Preserve is alpha software and currently in development (i.e., no tests).
Preserve is a simple (simplistic) key/value store for storing JSON-like data in different backends. Its API is based on the standard Python dictionary API.
ℹ️ Installation and Usage
Preserve can be installed using pip:
pip install preserve
Preserve can be also installed from Github directly using the following command:
pip install git+https://github.com/evhart/preserve#egg=preserve
📒 Requirements
Preserve needs the following libraries installed and Python 3.6+ (tested on Python 3.8):
🐍 Python API
If you know how to use Python dictionaries, you already know how to use preserve. Simply use the backend connector that corresponds to your database and you are ready to go.
You can either create a new database from a standarised database URI or using the driver parameters:
import preserve
# Using parameters:
jam_db1 = preserve.open('shelf', filename="preserve.dbm")
jam_db1['strawberry'] = {'name': 'Strawbery Jam', 'ingredients': ['strawberry', 'sugar']}
# Using URI:
jam_db2 = preserve.from_uri("mongodb://127.0.0.1:27017/preserves?collection=jam")
jam_db2['currant'] = {'name': 'Currant Jam', 'ingredients': ['currant', 'sugar']}
🖥️ Command Line Interface (CLI)
Preserve has a simple CLI utility that can be access using the preserve
command. Preserve support migrating/exporting data from one database ot another database and showing the firs rows from databases.
Usage: preserve [OPTIONS] COMMAND [ARGS]...
🥫 Preserve - A simple Key/Value database with multiple backends.
Options:
--install-completion [bash|zsh|fish|powershell|pwsh]
Install completion for the specified shell.
--show-completion [bash|zsh|fish|powershell|pwsh]
Show completion for the specified shell, to
copy it or customize the installation.
--help Show this message and exit.
Commands:
connectors List available connectors.
export Export a database to a different output.
header Get header of a given database table.
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
File details
Details for the file preserve-0.1.2a0.tar.gz
.
File metadata
- Download URL: preserve-0.1.2a0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.8.2 Darwin/20.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4510dfbc784c41d238b8668888fb43c1a330a171ef75d02813e7c9a96d7ff400 |
|
MD5 | 7d320d1dc121cbcf7c4f1e26f1cfdf24 |
|
BLAKE2b-256 | cb47e367efb393ca9933be9027169cbfa7f5c9354c7943fec5bfb44e657993aa |
File details
Details for the file preserve-0.1.2a0-py3-none-any.whl
.
File metadata
- Download URL: preserve-0.1.2a0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.8.2 Darwin/20.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79f5732a00539ed844f8b59d444dd501c09b7ede5628e114726cc3fdec776da9 |
|
MD5 | f5a6223dffb8054e2654b3a7b7278bb8 |
|
BLAKE2b-256 | 4043de042040e9657e2426e594d7dce267df8afa78c9513229bbdc34a1353a12 |