$npx skillfedfor your agent

marisa-trie

Static memory-efficient and fast Trie-like structures for Python.

With conditionsPyPI Python ModulesReleased Apr 20264.7M downloads / moMIT AND (BSD-2-Clause OR LGPL-2.1-or-later)Platform wheel

Decision gist · record as of 2026-08-14

platform wheels — marisa_trie-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl · marisa_trie-1.4.1-cp310-cp310-macosx_11_0_arm64.whl · marisa_trie-1.4.1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
v1.4.1 · released 2026-04-08 · Python >=3.9

Yes, if you have a static string dataset and memory efficiency is a priority. The package is actively maintained, supports modern Python versions (3.9–3.14), has no known vulnerabilities, and offers prebuilt wheels for most platforms. The copyleft license (LGPL/BSD 2-clause bundled library) requires compliance but is not a blocker for most use cases. Install friction is moderate due to C++ compilation, but wheels mitigate this for common platforms.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later; compiled C++ extension requires a compatible C++ compiler at build time if wheels are not available for your platform.
  • Medium install friction due to compiled C++ extensions, but prebuilt wheels are available for Python 3.9–3.14 across macOS, Linux (including aarch64), Windows, and musllinux platforms.
  • Actively maintained with recent releases.

License · maintenance · safety

MIT AND (BSD-2-Clause OR LGPL-2.1-or-later) (copyleft) — Dual licensing: wrapper code is MIT; bundled C++ library is dual-licensed under LGPL or BSD 2-clause. Users must comply with LGPL or BSD 2-clause terms for the underlying library.

last release 2026-04-08 (128 days) · last repo commit 2026-07-20 · 1,123 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,718,771 downloads/mo, #2,245 on PyPI

Verify before relying

pip install marisa-trie

from marisa_trie import Trie

trie = Trie(['apple', 'application', 'apply'])
if 'apple' in trie:
    print(trie.key_id('apple'))
  • Whether the 50x-100x memory reduction claim applies to all data sizes or primarily to large datasets.
  • Performance characteristics of prefix search and other advanced methods compared to alternative trie implementations.
  • Practical use-case suitability for dynamic (mutable) datasets, given the static/immutable design.
Same gist for agents: .md · .json

What it is and what it does

marisa-trie wraps the MARISA C++ trie library to provide immutable, memory-efficient trie data structures for Python. It trades mutability for dramatic memory savings and fast lookups on static string collections. The package includes Trie (for string-to-integer ID mapping), BytesTrie (for arbitrary byte sequences), RecordTrie (for string-to-value mappings), and StringTrie (for string-to-string mappings). All structures support prefix search and iteration over keys and items.

The primary use case is storing and querying large static string datasets—such as dictionaries, word lists, or IP address ranges—where memory footprint is a concern. Once built, a trie is serialized to disk and can be memory-mapped for fast access without reloading into RAM. The trade-off is that the trie cannot be modified after creation; new data requires rebuilding.

Use it for

  • Store a large dictionary or word list for spell-checking or autocomplete with minimal memory overhead.
  • Index IP addresses or network prefixes for fast lookup and prefix-based filtering.
  • Build a static lexicon for natural language processing tasks requiring efficient string-to-ID or string-to-value mapping.
  • Implement a fast prefix-search engine over a fixed set of strings (e.g., domain names, product SKUs).
  • Serialize and memory-map a trie to disk for fast startup and low-memory footprint in long-running services.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you have a static string dataset and memory efficiency is a priority.

The package is actively maintained, supports modern Python versions (3.9–3.14), has no known vulnerabilities, and offers prebuilt wheels for most platforms. The copyleft license (LGPL/BSD 2-clause bundled library) requires compliance but is not a blocker for most use cases. Install friction is moderate due to C++ compilation, but wheels mitigate this for common platforms.

Install

marisa-trie on PyPI

Before you install

Medium install friction due to compiled C++ extensions, but prebuilt wheels are available for Python 3.9–3.14 across macOS, Linux (including aarch64), Windows, and musllinux platforms. Actively maintained with recent releases.

Requires Python 3.9 or later; compiled C++ extension requires a compatible C++ compiler at build time if wheels are not available for your platform.

License in practice

Dual licensing: wrapper code is MIT; bundled C++ library is dual-licensed under LGPL or BSD 2-clause. Users must comply with LGPL or BSD 2-clause terms for the underlying library.

Quickstart

pip install marisa-trie

from marisa_trie import Trie

trie = Trie(['apple', 'application', 'apply'])
if 'apple' in trie:
    print(trie.key_id('apple'))

Verify before relying

  • Whether the 50x-100x memory reduction claim applies to all data sizes or primarily to large datasets.
  • Performance characteristics of prefix search and other advanced methods compared to alternative trie implementations.
  • Practical use-case suitability for dynamic (mutable) datasets, given the static/immutable design.

Package facts

LicenseMIT AND (BSD-2-Clause OR LGPL-2.1-or-later) copyleft
Python supportSupports the current Python release >=3.9
Install frictionMedium. Platform-specific wheel
Runtime dependenciesNone
MaintenanceActively maintained 128 days since the last release
Last repo commit
First released
Downloads4,718,771 / month, #2,245 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Free Threading :: 2 - BetaProgramming Language :: Python :: Implementation :: CPythonTopic :: Scientific/Engineering :: Information AnalysisTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: Linguistic

Evidence: marisa_trie-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl; marisa_trie-1.4.1-cp310-cp310-macosx_11_0_arm64.whl; marisa_trie-1.4.1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; marisa_trie-1.4.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; marisa_trie-1.4.1-cp310-cp310-musllinux_1_2_aarch64.whl; marisa_trie-1.4.1-cp310-cp310-musllinux_1_2_x86_64.whl; marisa_trie-1.4.1-cp310-cp310-win32.whl; marisa_trie-1.4.1-cp310-cp310-win_amd64.whl; marisa_trie-1.4.1-cp310-cp310-win_arm64.whl; marisa_trie-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl; marisa_trie-1.4.1-cp311-cp311-macosx_11_0_arm64.whl; marisa_trie-1.4.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; marisa_trie-1.4.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; marisa_trie-1.4.1-cp311-cp311-musllinux_1_2_aarch64.whl; marisa_trie-1.4.1-cp311-cp311-musllinux_1_2_x86_64.whl; marisa_trie-1.4.1-cp311-cp311-win32.whl; marisa_trie-1.4.1-cp311-cp311-win_amd64.whl; marisa_trie-1.4.1-cp311-cp311-win_arm64.whl; marisa_trie-1.4.1-cp312-cp312-macosx_10_13_x86_64.whl; marisa_trie-1.4.1-cp312-cp312-macosx_11_0_arm64.whl

Tags

Capabilities
memory-efficient trie data structurefast prefix search stringscompact string storage pythontrie lookup performancelow-memory string indexingmarisa trie implementationstatic trie structures
Topics
memory-efficientstatic-data-structuresstring-indexing

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “memory-efficient trie data structure”

  • marisa-trieProvides memory-efficient trie data structures for fast string…
  • trieImplements the Ethereum Merkle Trie data structure for efficient…
  • pygtriepygtrie provides pure Python implementations of trie (prefix tree)…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also pygtrie · PyTrie · trie · immutables · sqltrie · retrie · cidr-trie · pyahocorasick · intbitset