**kycli** is a high-performance Python CLI toolkit built with Cython for speed.
Project description
🔑 kycli — High-Performance Key-Value Toolkit
kycli is a lightweight, blazing-fast key-value storage engine built with Cython and SQLite. It offers both a robust Command Line Interface (CLI) for terminal productivity and a Pythonic library API for seamless integration into your applications.
🚀 Quick Start
Installation
pip install kycli
Basic Terminal Flow
# Save a secret
kys my_api_key "sk-proj-12345"
# Retrieve it
kyg my_api_key
# List everything
kyl
💻 CLI Usage
The CLI is designed to be intuitive and safe, featuring overwrite protection and atomic operations.
| Command | Action | Example |
|---|---|---|
kys |
Save a value | kys username "balu" |
kyg |
Get a value (supports Regex) | kyg "user.*" |
kyl |
List keys (supports Regex) | kyl "prod_.*" |
kyv |
View history/audit logs | kyv username |
kyd |
Delete a key | kyd old_token |
kye |
Export data (CSV/JSON) | kye data.json json |
kyi |
Import data | kyi backup.csv |
🛡️ Safety Features
- Interactive Propts:
kycliwill ask for confirmation (y/n) before overwriting an existing key. - Normalization: Keys are automatically lowercased and trimmed to prevent "hidden" duplicates.
- Atomic Exports: Uses a temp-and-move strategy so your data is never left in a corrupted state if an export fails.
🐍 Python Library API
Use kycli programmatically in your Python projects. It provides a standard dictionary-like interface for maximum ease of use.
Basic Implementation
from kycli import Kycore
# Use as a context manager for safe DB closure
with Kycore() as core:
# Set and Get (Dict-style)
core['app:mode'] = 'production'
print(core['app:mode']) # Output: production
# Check for existence
if 'app:mode' in core:
print("Configuration found!")
# Bulk count
print(f"Total keys: {len(core)}")
Advanced Library Features
with Kycore() as core:
# 1. Regex Searching
# Returns a dict of all matching key-values
matches = core.getkey("app:.*")
# 2. Audit History
# Get all previous values and timestamps for a key
history = core.get_history("app:mode")
for key, value, timestamp in history:
print(f"[{timestamp}] {value}")
# 3. Import/Export Programmatically
core.import_data("config.json")
core.export_data("backup.csv", file_format="csv")
🛠 Architecture & Performance
- Cython Core: The heavy lifting is done in C-compiled Python for near-native performance.
- SQLite Engine: Leverages the reliability of SQLite3 for persistence, ensuring your data survives crashes.
- Audit Trail: Every single change is logged with a timestamp in a separate
audit_logtable, giving you a full "undo" history.
👤 Author
Balakrishna Maduru
Generated by Antigravity
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
File details
Details for the file kycli-0.1.2.tar.gz.
File metadata
- Download URL: kycli-0.1.2.tar.gz
- Upload date:
- Size: 128.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7c9a9086dd9d44702e3571cb1133f5e016f310e8626bed35162d407faf93b10
|
|
| MD5 |
0c365eeecaa89614c99935d3b6fb326d
|
|
| BLAKE2b-256 |
5d92d749808c8d98b9e205e23039a95db0f6e8735db98d83f736502ac5379777
|
Provenance
The following attestation bundles were made for kycli-0.1.2.tar.gz:
Publisher:
publish.yml on balakrishna-maduru/kycli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kycli-0.1.2.tar.gz -
Subject digest:
b7c9a9086dd9d44702e3571cb1133f5e016f310e8626bed35162d407faf93b10 - Sigstore transparency entry: 789218147
- Sigstore integration time:
-
Permalink:
balakrishna-maduru/kycli@b1b1dc9f9ea83c499dc199c0cda73a5a86e4e176 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/balakrishna-maduru
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b1b1dc9f9ea83c499dc199c0cda73a5a86e4e176 -
Trigger Event:
push
-
Statement type: