
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
marisa-trie
Advanced tools
|PyPI Version| |PyPI Status| |PyPI Python Versions| |Github Build Status|
.. tip::
Become **my boss** to help me work on this awesome software, and make the world better:
|Patreon|
Static memory-efficient Trie-like structures for Python (3.8+)
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
::
python -m pip install -U marisa-trie
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.html
.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);keys()
and items()
methods but no values()
method.Wrapper code is licensed under MIT License.
Bundled marisa-trie
_ C++ library is dual-licensed under
LGPL or BSD 2-clause license.
.. |PyPI Version| image:: https://img.shields.io/pypi/v/marisa-trie.svg :target: https://pypi.python.org/pypi/marisa-trie/ .. |PyPI Status| image:: https://img.shields.io/pypi/status/marisa-trie.svg :target: https://pypi.python.org/pypi/marisa-trie/ .. |PyPI Python Versions| image:: https://img.shields.io/pypi/pyversions/marisa-trie.svg :target: https://pypi.python.org/pypi/marisa-trie/ .. |Github Build Status| image:: https://github.com/pytries/marisa-trie/actions/workflows/tests.yml/badge.svg :target: https://github.com/pytries/marisa-trie/actions/workflows/tests.yml .. |Patreon| image:: https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white :target: https://www.patreon.com/mschoentgen
libmarisa-trie
to the latest version (0.2.7) (#116).pyproject.toml
(#120).Trie.map()
(#90).Trie.iter_prefixes_with_ids()
method to return (prefix, id)
pairs (#83).ResourceWarning: unclosed file
in setup.py
.black
on the entire source code.libmarisa-trie
to the latest version (0.2.6).DeprecationWarning
messages in Trie.save
and
Trie.load
.MANIFEST.in
was not updated after libmarisa-trie
became a submodule.BinaryTrie
for storing arbitrary sequences of bytes, e.g. IP
addresses (thanks Tomasz Melcer);Trie.has_keys_with_prefix
which can be trivially implemented in
terms of Trie.iterkeys
;Trie.read
and Trie.write
which onlywork for "real" files
and duplicate the functionality of load
and save
. See issue #31 on
GitHub;libmarisa-trie
to the latest version. Yay, 64-bit Windows support.trie1 == trie2
and trie1 != trie2
now work (thanks Sergei Lebedev);for key in trie:
is fixed (thanks Sergei Lebedev);Trie
methods: __getitem__
, get
, items
, iteritems
.
trie[u'key']
is now the same as trie.key_id(u'key')
.BytesTrie.get
.Trie.restore_key
optimization (it should work 5-15% faster)Trie.restore_key
method - it was reading past declared string length;has_keys_with_prefix(prefix)
method (thanks
Matt Hickford <https://github.com/matt-hickford>
_)BytesTrie.iterkeys
, BytesTrie.iteritems
,
RecordTrie.iterkeys
and RecordTrie.iteritems
methods;value_separator
parameter for BytesTrie
and RecordTrie
.weights
optional parameter;.items()
and .keys()
methods for all tries;
faster (up to 3x) .prefixes()
method for Trie
..get(key, default=None)
method for BytesTrie
and RecordTrie
;load
, read
and mmap
methods returns 'self';.prefixes()
support for RecordTrie and BytesTrie.Initial release.
FAQs
Static memory-efficient and fast Trie-like structures for Python.
We found that marisa-trie demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.