Skip to main content

**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.

Python Version License: MIT


🚀 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: kycli will 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_log table, giving you a full "undo" history.

👤 Author

Balakrishna Maduru


Generated by Antigravity

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

kycli-0.1.1.tar.gz (132.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: kycli-0.1.1.tar.gz
  • Upload date:
  • Size: 132.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kycli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bc0a30357f0b4c56d23963251e6da179b14a9b759915c8698cd27feb12f1ef7a
MD5 db77e3148b041088bebe9ae5061713ac
BLAKE2b-256 f1f3ef6a8f4b143cea5a5c6f77cabe544880120870bd60c2c5246ee006eb42e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for kycli-0.1.1.tar.gz:

Publisher: publish.yml on balakrishna-maduru/kycli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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