evoid-smart-storage
Multi-DB routing — Intent Handler system
Quick Start • Intent Handler • Routing • API
Quick Start
uv add evoid-smart-storage
Method 1: Intent Handler (Recommended)
from evoid_smart_storage import register_handlers
from evoid.core.storage import storage_read, storage_write
# Register Smart Storage as storage handler
register_handlers(config={
"mapping": {
"credentials": "postgresql",
"session": "redis",
"logs": "memory",
},
})
# Routes automatically based on data type
await storage_write("cred:db_pass", {"password": "secret"})
await storage_write("session:abc", {"user": "alice"})
Method 2: Direct API
from evoid_smart_storage import SmartStorage
storage = SmartStorage(config={...})
await storage.write("key", {"data": "value"})
Intent Handler
evoid-smart-storage registers these Intent handlers:
| Intent | Handler | Description |
|---|---|---|
storage.read |
handle_read |
Read with smart routing |
storage.write |
handle_write |
Write with smart routing |
storage.delete |
handle_delete |
Delete with smart routing |
storage.health |
handle_health |
Check all backends |
Routing
Smart Storage routes data based on:
- Data type — credentials → PostgreSQL, sessions → Redis
- Intent level — CRITICAL → PostgreSQL, STANDARD → SQLite
- User ID — multi-tenancy support
- Metadata override — explicit backend selection
Configuration
TOML
[engines]
storage = "smart_storage"
[engines.options.smart_storage]
mapping = { credentials = "postgresql", session = "redis" }
API
register_handlers(config: dict)
Register Smart Storage as Intent handlers.
SmartStorage Methods
| Method | Signature | Returns | Description |
|---|---|---|---|
read |
async read(key: str) |
Any | None |
Read with routing |
write |
async write(key: str, data: dict) |
bool |
Write with routing |
delete |
async delete(key: str) |
bool |
Delete with routing |
health |
async health() |
bool |
Check all backends |
How It Works
Smart Storage reads the mapping config and routes each key to the correct backend:
credentials→ PostgreSQL (sensitive data)session→ Redis (ephemeral)logs→ Memory (debug)
Level routing sends CRITICAL Intents to PostgreSQL, STANDARD to SQLite. Your handler code never sees the routing logic.
Dependencies
evoid>=0.4.0- At least one storage plugin (sqlite, postgresql, redis, etc.)
Links
License
MIT
Metadata
Release files for evoid-smart-storage 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evoid_smart_storage-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for evoid_smart_storage-0.2.0-py3-none-any.whl |
Release files / evoid_smart_storage-0.2.0-py3-none-any.whl
| Download URL | evoid_smart_storage-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
865ed3722b096ab536f2760916cd5fd7c9f9835ba949ac85282c811df305424a
|
|
BLAKE2b-256 checksum How to use checksums |
45baf1881752b7792ac8d7367b53c47f299b3cd94b2de668d31f37537c37d5d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for evoid-smart-storage 0.2.0
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.