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
pip install trie-again
# in some cases you might want to adjust your compiler (the same is applicable for `poetry install`)
CC='gcc' CFLAGS='-march=native' pip install trie-again
# create an instance
from trie_again import Trie
# if you want to use faster version
from trie_again import CyTrie
trie = Trie()
# insert a single word
trie.insert('boy')
# insert a list of words
trie.extend(['bondage', 'coverage'])
# insert a list of words with multipliers (useful when parsing json)
data = {
'bondage': 10,
'coverage': 20,
}
trie.extend(data.keys(), data.values())
# check key in trie
print('bondage' in trie)
# True
# list all keys, sorted by usage
print(list(trie))
# ['coverage', 'bondage', 'boy']
# complete simple, sorted by usage
print(list(trie.complete('b')))
# ['bondage', 'boy']
# complete with t9 like approach
print(list(trie.complete(['bc', 'o', 'vn'])))
# ['coverage', 'bondage']
b o y
b o n d a g e
c o v e r a g e
^ ^ ^
1 2 3
We use these groups to complete: bc
, o
, vn
. It means that at position 1 it the letter may be b
or c
, at position 2 only o
, at position 3 v
or n
.
# test behavior
poetry run pytest
# test performance
poetry run pytest --benchmark
# very start (adjust compiler options if needed)
poetry install
# install pre commit
poetry run pre-commit install
# lint
poetry run black .
poetry run flake8 .
poetry run mypy .
# coverage
poetry run coverage run -m pytest && poetry run coverage report -m
# build package: limiting to sdist to compile it on install
poetry build -f sdist
FAQs
Trie data structure for prefix search and text completion
We found that trie-again demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.