Wind-KVStore Python SDK
A Python wrapper for a high-performance Rust-based key-value storage engine, providing a stable and reliable data persistence solution.
Project Structure
wind-kvstore-lib/
├── Cargo.toml # Rust project configuration
├── pyproject.toml # Python packaging configuration
├── src/
│ ├── lib.rs # PyO3 module entry point
│ └── kvstore.rs # Core storage engine implementation
└── wind_kvcore/
├── __init__.py # Package exports
├── WindKVCore.py # Python wrapper class
└── wind_kvcore.pyi # Type hint file
Requirements
System Requirements
- Operating Systems: Windows, Linux, macOS
- Python: 3.10 or higher
- Rust Toolchain: Required for compiling from source
Required Tools
-
Python 3.10+
-
Rust Toolchain
# Install Rust sudo snap install rustup
-
Maturin
pip install maturin
Installation
Building from Source
- Clone the project:
git clone https://github.com/starwindv/wind-kvstore-lib
cd wind-kvstore-lib
- Build and install using maturin:
maturin build
pip install target/wheels/wind_kvcore-*.whl
Usage
Basic Operations
from wind_kvcore import WindKVCore
# Open database (creates if it doesn't exist)
with WindKVCore("./mydatabase.db") as db:
# Store data
db.put(b"key1", b"value1")
db.put(b"key2", b"value2")
# Read data
value = db.get(b"key1")
print(f"key1: {value}") # Output: b'value1'
# Delete data
db.delete(b"key2")
# Get all key-value pairs
all_data = db.get_all()
for item in all_data:
print(f"{item['key']}: {item['value']}")
Database Identifier Management
# Specify identifier during creation
db = WindKVCore("./data.db", "my_database")
# Or set identifier later
db.set_identifier("new_identifier")
current_id = db.get_identifier()
print(f"Current database identifier: {current_id}")
Performance Optimization
# Use context manager to ensure proper resource cleanup
with WindKVCore("./data.db") as db:
# Perform operations...
pass
API Reference
WindKVCore Class
Initialization
WindKVCore(path: str, db_identifier: Optional[str] = None)
Main Methods
get(key: bytes) -> Optional[bytes]- Get value by keyput(key: bytes, value: bytes) -> None- Store or update key-value pairdelete(key: bytes) -> None- Delete key-value pairget_all() -> List[Dict[str, str]]- Get all key-value pairscompact() -> None- Compact database to optimize performanceset_identifier(identifier: str) -> None- Set database identifierget_identifier() -> str- Get current database identifierclose() -> None- Close database connection
License
This project is licensed under the MIT License - see the LICENSE file for details.
Original Project
- Project Homepage: GitHub Repository
- Author: StarWindv
Metadata
Release files for wind-kvcore 0.0.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 | Provenance | Actions |
|---|---|---|---|---|
| wind_kvcore-0.0.2.tar.gz | 35.7 kB | Without provenance | Details for wind_kvcore-0.0.2.tar.gz |
Release files / wind_kvcore-0.0.2.tar.gz
| Download URL | wind_kvcore-0.0.2.tar.gz |
|---|---|
| Size | 35.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b4b6afa7fbe46c94949ab358d0a8acea9ca8dddb776e1940feaa1ca29d97b45
|
|
BLAKE2b-256 checksum How to use checksums |
14200da786d3ef45b7dd251a9cc077461ff10ded84c63c538cfe0e81433eddca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.6
|
Security for wind-kvcore 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.