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.
Metadata
Release files for lmcmd 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lmcmd-0.1.2.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lmcmd-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.7 kB
Release files / lmcmd-0.1.2.tar.gz
| Download URL | lmcmd-0.1.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd712573f1f211d05e3b55d5d087d69e47e6a1c92ca22350f74242e279279d94
|
|
BLAKE2b-256 checksum How to use checksums |
b8cad2d8239919b0ec25f103b31f70379fdc0c06cf80c43381b9aef336b74664
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.8.10 Linux/6.6.40-amd64-desktop-hwe
|
Release files / lmcmd-0.1.2-py3-none-any.whl
| Download URL | lmcmd-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74e838a1c7d803ff2296c595fee0530d2df0524806d22ab4200a777d33a99386
|
|
BLAKE2b-256 checksum How to use checksums |
271fa0ffe303a1b024102ad1686cbdc573e8d4658beb2cfb89832e35dec71d1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.8.10 Linux/6.6.40-amd64-desktop-hwe
|