Skip to main content

lantern-sdk (Python)

Python client SDK for Lantern, an in-memory graph key-vertex-store served over gRPC. Mirrors the Go SDK feature set: single + batch vertex/edge operations, prefix scans, prefix delete, Illuminate (k-bounded BFS with TF-IDF / MST / SPT post-processing), and the gRPC health check.

v0.1.x is sync-only (grpc blocking stubs). An asyncio companion built on grpc.aio is planned for v0.2; see the tracking issue.

Install

Distributed on PyPI as lantern-sdk; the Python import package name remains lantern_client.

pip install lantern-sdk
# or with uv
uv add lantern-sdk

Quick start

from lantern_client import Lantern

with Lantern.connect("localhost:6380") as cli:
    cli.put_vertex("user:1", {"name": "alice"}, ttl_seconds=3600)
    v = cli.get_vertex("user:1")
    print(v)  # Vertex(key='user:1', value={'name': 'alice'}, ...)

    cli.add_edge("user:1", "post:42", weight=1.5, ttl_seconds=3600)
    graph = cli.illuminate("user:1", step=2, k=10)
    print(graph.vertices, graph.edges)

Lantern.connect accepts the same target forms as the Go SDK:

  • "host:port" — single endpoint.
  • "dns:///host:port" — DNS fan-out with round-robin load balancing.
  • Lantern.connect_endpoints([...]) — explicit static endpoint list.

See examples/quickstart.py for the full surface.

Value types

put_vertex accepts native Python values; the SDK picks the right protobuf oneof variant. Supported types: int, float, bool, str, bytes, datetime.datetime, datetime.timedelta, None (tombstone).

int values land in int64 or uint64 based on sign; float always lands in float64. Use the explicit constructors in lantern_client.values (int32, uint32, float32) to pin a narrower wire type. Reading is symmetric — vertex.value returns the natural Python type; vertex.kind is the VertexKind enum if you need to dispatch without isinstance.

Codegen

Generated protobuf / gRPC stubs live under src/lantern_client/_pb/ and are committed to the repo, mirroring how Lantern's Go module keeps pb/ in-tree. To regenerate after a .proto change:

uv run --dev scripts/codegen.sh

License

Apache-2.0 — see LICENSE.

Metadata

Release files for lantern-sdk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lantern-sdk 0.1.1
File Size Uploaded Provenance Actions
lantern_sdk-0.1.1.tar.gz 28.1 kB With provenance Details for lantern_sdk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lantern-sdk 0.1.1
File Interpreter ABI Platform Actions
lantern_sdk-0.1.1-py3-none-any.whl Python 3 none any Details for lantern_sdk-0.1.1-py3-none-any.whl

Total release size: 61.5 kB

Release files / lantern_sdk-0.1.1.tar.gz

Download URL lantern_sdk-0.1.1.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
52c09f266e71bc5025050ca1fa66d02388a90e05157686bb32192050fabb24bf
BLAKE2b-256 checksum
How to use checksums
dd30a487bb8b9e6cb306da1b4f5c6ff07ff60339f964a43cb7bf0bd0cd96d8fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release files / lantern_sdk-0.1.1-py3-none-any.whl

Download URL lantern_sdk-0.1.1-py3-none-any.whl
Size 33.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bfa0d3bb3c5a4d81a6735766280ba70c9cf4665ce737fd3a9a5df3b0c3d7e56
BLAKE2b-256 checksum
How to use checksums
11cb33a10d134ee017dc7ea5b4cca4124717d36e21aa59da83c874b10dd36d73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Security for lantern-sdk 0.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lantern_sdk-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page