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 linked directly against the Raw SQLite C API (libsqlite3). It offers both a robust Command Line Interface (CLI) for terminal productivity and a high-performance, asynchronous Python library API.

Python Version License: MIT


⚡ Performance: Redefining "Fast"

By removing the Python sqlite3 wrapper and using direct C-level interactions, kycli achieves microsecond-level latency that rivals in-memory stores like Redis.

Operation Implementation Avg Latency Comparison
Get Key Direct C API 0.0028 ms (2.8 µs) 150x faster than standard Python wrappers
Get Key Async (Threadpool) 0.0432 ms Ideal for high-throughput backends
Save Key Atomic Sync 0.1895 ms Durable Disk I/O

🚀 Quick Start

Installation

pip install kycli

Basic Terminal Flow

# Save a secret
kys my_api_key "sk-proj-12345"

# Retrieve it (Microsecond speed)
kyg my_api_key

# List everything with Regex support
kyl "api_.*"

💻 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

🐍 Python Library API

Synchronous (High-Speed)

from kycli import Kycore

with Kycore() as core:
    # Set and Get (Dict-style)
    core['app:mode'] = 'production'
    print(core['app:mode'])  # 2.8 µs retrieval

Asynchronous (High-Throughput)

Perfect for FastAPI, Sanic, or any asyncio based application.

import asyncio
from kycli import Kycore

async def main():
    with Kycore() as core:
        # Non-blocking async operations
        await core.save_async('session:id', 'xyz789')
        val = await core.getkey_async('session:id')
        print(f"Fetched: {val}")

asyncio.run(main())

🛡️ Key Features

  • Raw C Integration: Direct binding to libsqlite3 for zero abstraction overhead.
  • Asynchronous I/O: Offloaded database tasks using thread-pools for non-blocking execution.
  • Audit Logging: Full history of key-value changes kept in an indexed audit_log table.
  • Overwrite Protection: Interactive (Y/N) confirmation prevents accidental data loss.
  • Atomic Operations: Exports and imports use temporary staging to prevent file corruption.

🛠 Architecture

  • Engine: SQLite 3 (WAL Mode enabled for high concurrency).
  • Core: Compiled via Cython to machine code.
  • Security: Keys are lowercased and stripped automatically to maintain data integrity.

👤 Author

Balakrishna Maduru


Optimized for Performance 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.3.tar.gz (129.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: kycli-0.1.3.tar.gz
  • Upload date:
  • Size: 129.0 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.3.tar.gz
Algorithm Hash digest
SHA256 9b31769f2df916dc752d41a718ceb17b86e9102e5feeb723b09d08fc3974a30b
MD5 3dd68c1eb1774083095681d610f700da
BLAKE2b-256 98be9f9fb3709e381350b3750ff70e9f23688e89d202f4e2e4705576bb87b647

See more details on using hashes here.

Provenance

The following attestation bundles were made for kycli-0.1.3.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