Metadata-Version: 2.4
Name: spedo
Version: 0.69.0.post1
Summary: Official Native Python Client SDK for Spedo Ultra-Fast In-Memory AI & Data Engine
Home-page: https://spedo.dev
Author: Spedo Engine Team
Author-email: contact@spedo.dev
Project-URL: Documentation, https://spedo.dev/docs/index.html
Project-URL: Command reference, https://spedo.dev/docs/command-reference.html
Keywords: spedo redis in-memory cache vector-search ai simd cdc high-performance database
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# Spedo Python SDK

**Build reactive applications around a Rust in-memory data engine.**

`spedo` is the Python SDK for Spedo. It provides standard TCP connections,
key/value operations, an optional in-process cache, reactive variables,
and access to the engine's documented data and coordination features.

## Installation

```bash
python -m pip install spedo
```

Requires Python 3.8 or later. The package includes the `spedo` package and the
`spedo_client` import used in the examples below.

This installs the Python SDK, not the Rust server. For networked use, connect
to a separately running Spedo server. See the
[deployment guide](https://spedo.dev/docs/guides/security-hardening).

## Quick start

```python
from spedo_client import SpedoClient

client = SpedoClient(host="127.0.0.1", port=6380)
try:
    client.set("demo:message", "Hello from Spedo", ex=60)
    print(client.get("demo:message"))  # b"Hello from Spedo"
finally:
    client.close()
```

The example assumes a reachable development server. Configure authentication
and private network access for your deployment as described in the deployment
guide.

## Reactive variables with `bind_var`

Bind a server key to a Python object and read its current value from local
memory. Feature flags, runtime settings and job status are typical uses.

```python
from spedo_client import SpedoClient

client = SpedoClient(host="127.0.0.1", port=6380)
flag = client.bind_var("demo:checkout_enabled", default=False)

@flag.on_change
def on_flag_change(value):
    print("Checkout flag updated:", value)

try:
    flag.value = True  # Publish a value to the server.
    if flag.value:    # Read the local value.
        print("Checkout enabled")
finally:
    flag.close()
    client.close()
```

Other connected bindings receive a watch invalidation, reload the value from
the server, and then notify callbacks and async waiters. Updates propagate
asynchronously; a local read can briefly be stale. The initial load and each
refresh use the network. `default` is a local fallback and does not create a
server key. Assign a new `.value` to publish changes rather than mutating a
bound dictionary in place.

The binding also supports `wait_change()` and `wait_until(...)` for async
applications. Read the [reactive data guide](https://spedo.dev/docs/guides/reactive-data-and-cdc).

## Optional local cache

```python
from spedo_client import SpedoClient

client = SpedoClient(
    host="127.0.0.1",
    port=6380,
    local_proxy=True,
    local_cache_max_bytes=8 * 1024 * 1024,
)
try:
    client.set("demo:catalog", "Cached catalog", ex=60)
    client.get("demo:catalog")  # Load into the local cache.
    client.get("demo:catalog")  # A hot hit can be served in-process.
finally:
    client.close()
```

The proxy uses a bounded LRU cache and watch-based invalidation. Local-cache
hits and buffered write enqueue rates are different from acknowledged server
operations.

## Features and tools

Availability depends on the server version, configuration and license.

| Area | Capabilities |
| --- | --- |
| Data access | Key/value operations, TTL, pipelines and Python object storage |
| Reactive applications | Live variables and dictionaries, callbacks, async waiters and CDC |
| Client acceleration | Local L1 cache, prefetch and buffered write-behind |
| Jobs and coordination | FairShare priority queues, delayed jobs and workflows |
| Search and computation | Vector similarity, hybrid search, matrices and server-side scripting |
| Memory and recovery | JSON models, LZ4 compression, and qualified KV/JSON snapshots and WAL |
| Operations | Control Center, Prometheus/Grafana monitoring and a diagnostic support-bundle command |

See the [command reference](https://spedo.dev/docs/command-reference.html)
for command syntax and the [documentation](https://spedo.dev/docs/index.html)
for feature guides.

## Deployment and data scope

Spedo is a **single-node preview** supporting a documented subset of RESP.
It is intended for bounded, rebuildable workloads with explicit recovery
requirements. Standard TCP/IP connections work across container networks;
networked SDK use does not require shared memory.

The qualified snapshot/WAL contract covers KV and JSON. Treat specialized
structures such as vectors, queues and streams as rebuildable in-memory
state unless their lifecycle is explicitly qualified. This is not a claim of
Redis Cluster compatibility, distributed high availability or durable messaging.

## Documentation and support

- [Spedo website](https://spedo.dev/)
- [Documentation overview](https://spedo.dev/docs/index.html)
- [Command reference](https://spedo.dev/docs/command-reference.html)
- [Reactive variables and CDC](https://spedo.dev/docs/guides/reactive-data-and-cdc)
- [Queues and workflows](https://spedo.dev/docs/guides/queues-and-workflows)
- [Persistence and recovery](https://spedo.dev/docs/guides/persistence-and-recovery)
- [Deployment and security](https://spedo.dev/docs/guides/security-hardening)
- [Control Center](https://spedo.dev/docs/guides/admin-control-center)
- [Support bundles](https://spedo.dev/docs/guides/support-bundle)

For support, contact **contact@spedo.dev**.
