Catalog PyPI
PACKAGE EXPLORERView in registry

affix-tree

PyPI

A trie-like data structure that allows storing and searching data based on the longest matching prefix or suffix of a given string.

prefixsuffixtreetrie
Versions collected1
Direct dependencies0From release 0.1.1
Last observed20 Oct, 21:05 UTC

README

Version 0.1.1 documentation

affix-tree

A trie-like data structure that allows storing and searching data based on the longest matching prefix or suffix of a given string.

Installation

pip install affix-tree

Usage

As a prefix tree

>>> from affix_tree import AffixTree

>>> prefix_tree: AffixTree[int] = AffixTree()
>>> prefix_tree.add('prefix', 1)
>>> prefix_tree.add('prefix-2', 2)

>>> prefix_tree.find('prefix-2-test')

2

As a suffix tree

>>> from affix_tree import AffixTree

>>> prefix_tree: AffixTree[int] = AffixTree(is_suffix_tree=True)
>>> prefix_tree.add('suffix', 1)
>>> prefix_tree.add('2-suffix', 2)

>>> prefix_tree.find('test-2-suffix')

2

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.115 Feb 20250

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
ean-db/affix-tree

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:05 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:e0799b28bcefb064321d1b09d65411c24e87c1c89a8fdae45b45c9585e65953c