Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
.. 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.yml
Static 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
::
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 and BSD 2-clause license.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.