Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pytries/marisa-trie
Static memory-efficient Trie-like structures for Python based on marisa-trie C++ library.
https://github.com/pytries/marisa-trie
cython-wrapper marisa marisa-trie python python3 python310 python311 python37 python38 python39 tree-structure trie
Last synced: 30 days ago
JSON representation
Static memory-efficient Trie-like structures for Python based on marisa-trie C++ library.
- Host: GitHub
- URL: https://github.com/pytries/marisa-trie
- Owner: pytries
- License: mit
- Created: 2012-08-17T21:35:25.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2024-02-10T11:27:24.000Z (9 months ago)
- Last Synced: 2024-04-11T13:07:56.805Z (7 months ago)
- Topics: cython-wrapper, marisa, marisa-trie, python, python3, python310, python311, python37, python38, python39, tree-structure, trie
- Language: Cython
- Homepage: https://marisa-trie.readthedocs.io/en/latest/
- Size: 2.24 MB
- Stars: 1,006
- Watchers: 26
- Forks: 90
- Open Issues: 16
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- Contributing: docs/contributing.rst
- License: LICENSE
- Authors: AUTHORS.rst
Awesome Lists containing this project
README
MARISA Trie
===========.. image:: https://img.shields.io/pypi/pyversions/marisa-trie.svg
:target: https://pypi.python.org/pypi/marisa-trie.. image:: https://github.com/pytries/marisa-trie/actions/workflows/tests.yml/badge.svg
:target: https://github.com/pytries/marisa-trie/actions/workflows/tests.ymlStatic memory-efficient Trie-like structures for Python (3.7+)
based on `marisa-trie`_ C++ library.String data in a MARISA-trie may take up to 50x-100x less memory than
in a standard Python dict; the raw lookup speed is comparable; trie also
provides fast advanced methods like prefix search... note::
There are official SWIG-based Python bindings included
in C++ library distribution; this package provides alternative
Cython-based pip-installable Python bindings... _marisa-trie: https://github.com/s-yata/marisa-trie
Installation
============::
python -m pip install -U marisa-trie
Usage
=====See `tutorial`_ and `API`_ for details.
.. _tutorial: https://marisa-trie.readthedocs.io/en/latest/tutorial.html
.. _API: https://marisa-trie.readthedocs.io/en/latest/api.htmlCurrent limitations
===================* The library is not tested with mingw32 compiler;
* ``.prefixes()`` method of ``BytesTrie`` and ``RecordTrie`` is quite slow
and doesn't have iterator counterpart;
* ``read()`` and ``write()`` methods don't work with file-like objects
(they work only with real files; pickling works fine for file-like objects);
* there are ``keys()`` and ``items()`` methods but no ``values()`` method.License
=======Wrapper code is licensed under MIT License.
Bundled `marisa-trie`_ C++ library is dual-licensed under
LGPL and BSD 2-clause license.