# pytries/marisa-trie

Static memory-efficient Trie-like structures for Python based on marisa-trie C++ library.

Repository: https://github.com/pytries/marisa-trie
Canonical: https://ross.abutalabs.com/products/marisa-trie
Homepage: https://marisa-trie.readthedocs.io/en/latest/
Language: Cython
License: MIT
License Family: permissive
Topics: trie, tree-structure, cython-wrapper, marisa, marisa-trie, python, python3, python310, python39, pypy3, python312, python313, python314
Last push: 2026-07-20T21:02:54+00:00

## Health v2 (maintenance only)
Score: 81/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 54, longevity 100
- inputs: {"age_days": 5129, "days_push": 44, "days_rel": 147, "gap_med": 112.0, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1123, forks 98 (observed 2026-08-28T04:03:40.388110+00:00)

## What it is
A Python library providing static, memory-efficient trie data structures built on the marisa-trie C++ library via Cython bindings. It stores string keys using 50x-100x less memory than a Python dict while offering comparable lookup speed and fast prefix search.

## Use cases
- store large dictionaries of strings with minimal memory
- fast prefix search / autocomplete lookups in Python
- memory-efficient string-to-value mapping
- build token dictionaries for NLP pipelines
- serialize compact string sets to disk

## When to choose
- you need immutable string key storage far more compact than a dict
- you need prefix-based queries like .prefixes() or common-prefix search
- you want pip-installable Python bindings for marisa-trie

## When to avoid
- you need mutable tries with frequent insertions and deletions
- you need a values() method or fast .prefixes() on BytesTrie/RecordTrie
- you need read()/write() with file-like objects (use pickling instead)

## Facets
- artifact type: library
- maturity: active
- function: search-engine, serialization
- domain: developer-tools
- platform: python, cross-platform
- tags: trie, marisa-trie, cython, memory-efficient, prefix-search, string-mapping, data-structures, algorithms, natural-language-processing

## Member repositories
- pytries/marisa-trie (main) score 81

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:40.388110+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:40:53.668520+00:00, confidence not recorded.
  - readme: https://github.com/pytries/marisa-trie (fetched 2026-08-28T04:03:40.388110+00:00, sha 15ac8b8ebb0a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
