Skip to main content

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):

Optioanal dependencies for specific backends:

🐍 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

preserve-1.1.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

preserve-1.1.1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file preserve-1.1.1.tar.gz.

File metadata

  • Download URL: preserve-1.1.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.5 Linux/6.11.0-1018-azure

File hashes

Hashes for preserve-1.1.1.tar.gz
Algorithm Hash digest
SHA256 a6cb38d52fc58e8357f22bcc51e92003cda6e741277b70b703f146c324440527
MD5 564d3f571e91f9f17ae00757265d5957
BLAKE2b-256 70cff98a65af3c2954df1b4661847d7ab5e75e8caaee2254eb19910ad76e7427

See more details on using hashes here.

File details

Details for the file preserve-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: preserve-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.5 Linux/6.11.0-1018-azure

File hashes

Hashes for preserve-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dba781f27a86ca9393bcdaddd7951e93765f99089e0dfb8d8ab825d4853707fb
MD5 ade80a216fb1c4a7c6cae6c5b4373c27
BLAKE2b-256 f1a301bfc17fb53a5d8d124d4e95117f74ccc51c90a5e427e7e353df213d39b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page