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. - search
<VALUE>: List value in the database key or value.
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)
>>> search Alice
{name: Alice}
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
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 lmcmd-0.1.2.tar.gz.
File metadata
- Download URL: lmcmd-0.1.2.tar.gz
- Upload date:
- Size: 5.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd712573f1f211d05e3b55d5d087d69e47e6a1c92ca22350f74242e279279d94
|
|
| MD5 |
3ee670e5f204cc7a4315a618486c4272
|
|
| BLAKE2b-256 |
b8cad2d8239919b0ec25f103b31f70379fdc0c06cf80c43381b9aef336b74664
|
File details
Details for the file lmcmd-0.1.2-py3-none-any.whl.
File metadata
- Download URL: lmcmd-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74e838a1c7d803ff2296c595fee0530d2df0524806d22ab4200a777d33a99386
|
|
| MD5 |
d207c15751cefce7a56ea5b3febf7363
|
|
| BLAKE2b-256 |
271fa0ffe303a1b024102ad1686cbdc573e8d4658beb2cfb89832e35dec71d1d
|