Skip to main content

Python client for the triedis trie server

Project description

triedis-py

Python client for triedis, an in-memory trie server.

Bundles the triedis Linux binary — no separate server install needed.

Installation

uv add triedis-py

Usage

Sync

from triedis_py import TriedisClient

with TriedisClient() as client:           # auto-starts bundled server
    trie = client.trie("words")
    trie.insert("cat")
    trie.insert("category")
    print(trie.contains("cat"))           # True
    print(trie.prefix_search("cat"))      # ["cat", "category"]

Async

from triedis_py import AsyncTriedisClient

async with AsyncTriedisClient() as client:
    trie = client.trie("words")
    await trie.insert("cat")
    print(await trie.prefix_search("ca")) # ["cat"]

Connect to existing server

with TriedisClient(auto_start=False, host="localhost", port=4657) as client:
    ...

Commands

Trie method Server command Returns
insert(word) SET <trie> <word> None
contains(word) GET <trie> <word> bool
prefix_search(prefix) TPREFIX <trie> <prefix> list[str]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

triedis_py-0.1.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

triedis_py-0.1.0-py3-none-manylinux_2_17_x86_64.whl (2.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

File details

Details for the file triedis_py-0.1.0.tar.gz.

File metadata

  • Download URL: triedis_py-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for triedis_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a6155b0d4c49f8338a16ad3cf07468d5dff0b698ee77ce484763901e5f14ed57
MD5 4f6c1a12a07613c00db59519cea0580d
BLAKE2b-256 ef13e11effa8765e13a67bec485f9a221c89ec593fe1951f0fe505061ad59eb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for triedis_py-0.1.0.tar.gz:

Publisher: publish.yml on joalon/triedis-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file triedis_py-0.1.0-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for triedis_py-0.1.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0d0df80bb54541ed6dbcd2a0ff61275f4b6960e379e4cec8e63af4b4d383f56e
MD5 5ca0cc02b97f1099c8a95bdcfd5d33f0
BLAKE2b-256 b0e93041aa6a886f7c1d29aef7d8894d87277c1c3f9242c5efb6618d869d2f09

See more details on using hashes here.

Provenance

The following attestation bundles were made for triedis_py-0.1.0-py3-none-manylinux_2_17_x86_64.whl:

Publisher: publish.yml on joalon/triedis-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page