Skip to main content

The Fast lmdb Command Client

Project description

LMCMD

Introduction

lmcmd is an interactive console based on Python's code.InteractiveConsole, supporting key-value database operations using LMDB.

Installation

You can install it using pip:

pip install lmcmd

Features

  • show: Display the current database name.
  • set <KEY> <VALUE>: Store key-value data.
  • get <KEY>: Retrieve the value of a specified key.
  • del <KEY>: Delete a specified key.
  • list: List all key-value pairs in the database.
  • export: Export database data to export.json.
  • import <ID> <FILE_PATH>: Import data from a JSON file.

Usage

1. Start the Terminal

After installation, you can run it directly from the command line:

lmcmd my_database

2. Interactive Commands Example

>>> set name Alice
Ok
>>> get name
Alice
>>> list
{name: Alice}
>>> export
Data Exported to export.json
>>> import id data.json
Data Imported!
>>> show
Database: my_database
>>> del name
Ok
>>> list
(Empty)

Explanation

Data Storage

All data is stored in the LMDB database. A KEY must be provided for set/get/del operations.

Data Export

Use the export command to save database data to export.json.

Data Import

import <ID> <FILE_PATH>

  • <ID>: The unique identifier field for the imported data.
  • <FILE_PATH>: The path to the JSON data file.

If the JSON data is formatted as follows:

[
  { "id": 1, "name": "Alice" },
  { "id": 2, "name": "Bob" }
]

Executing import id data.json will store the data using id as the key.

Dependencies

  • Python 3.8+
  • lmdb

License

This project is released under the MIT License.

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

lmcmd-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

lmcmd-0.1.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file lmcmd-0.1.1.tar.gz.

File metadata

  • Download URL: lmcmd-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.8.10 Linux/6.6.40-amd64-desktop-hwe

File hashes

Hashes for lmcmd-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7af501fbc9b74bdde211276bc44251e71016092ca54c1b6e82fd86d9be69807b
MD5 da5b345f6b0fea72850e2e59324b26f6
BLAKE2b-256 647735980c9135352a9b5569b1d568f4149c9d12eadebf548dc27f10ce8e0324

See more details on using hashes here.

File details

Details for the file lmcmd-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lmcmd-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.8.10 Linux/6.6.40-amd64-desktop-hwe

File hashes

Hashes for lmcmd-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44fe8bf7dc871c26f0e513f0ba6c03c42606bbd40ecce8043fd26d67171f78e5
MD5 258b4ef934325c2c4d05a867bd820ce6
BLAKE2b-256 e3ec945ad979bf547cd102d83280fd971e91b720955e52fd9d1b9c1d8d997899

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