Skip to main content

narsil-client

narsil-client calls a Narsil search server, or every node of a Narsil cluster, from Python 3.11 or later. It holds a typed method for every route that the server documents in its OpenAPI file, in a blocking form and in an async form with the same names.

This package sends HTTP requests to a server that the TypeScript package serves. A separate Python package that searches an index inside the Python process, built on the Rust crate, is planned in #173.

pip install narsil-client
from narsil_client import NarsilClient

with NarsilClient("http://localhost:9876") as client:
    client.create_index({"name": "movies", "config": {"schema": {"title": "string", "year": "number"}}})
    client.insert("movies", {"id": "the-matrix", "document": {"title": "The Matrix", "year": 1999}})
    results = client.query("movies", {"term": "matrix"})
    print([hit.id for hit in results.hits])

AsyncNarsilClient takes the same settings, and each of its methods is a coroutine that you await under asyncio or trio.

When you pass a list of addresses, the client moves a read to the next node after a refused or broken connection, a timeout, or an answer of 502, 503, or 504. It moves a write only when the request never left the client or when the node answers NODE_NOT_READY, so the client never sends a second copy of a write that a node may have applied. Every failure raises NarsilError, under the code that the server sent or under a CLIENT_ code for a failure on this side.

The Python client guide covers the settings, the helpers, streaming a snapshot or an export, and the failover rules in full.

License

Apache-2.0

Metadata

Release files for narsil-client 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 narsil-client 0.1.1
File Size Uploaded Provenance Actions
narsil_client-0.1.1.tar.gz 67.8 kB With provenance Details for narsil_client-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for narsil-client 0.1.1
File Interpreter ABI Platform Actions
narsil_client-0.1.1-py3-none-any.whl Python 3 none any Details for narsil_client-0.1.1-py3-none-any.whl

Total release size: 162.6 kB

Release files / narsil_client-0.1.1.tar.gz

Download URL narsil_client-0.1.1.tar.gz
Size 67.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a6d5b6e93fac09736727662bff641c228c839bb7c80d26a13c48e680227fe41d
BLAKE2b-256 checksum
How to use checksums
88a497acd0a3d9b95dcf5d6c8cf6be890860e71a6ec2ca0afcc801fd7df16db4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

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

Download URL narsil_client-0.1.1-py3-none-any.whl
Size 94.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3284aada0e8d7ce2780af03a21e36995553a6565867f3e936c3df11dc464c456
BLAKE2b-256 checksum
How to use checksums
19c4518b876f2b681ff73a195f7273ae27bcb692752e721237e701faf14ff82b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Security for narsil-client 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 narsil_client-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 Nov 11, 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