Skip to main content

Trie on RocksDB

Project description

rocktrie

A trie library based on a single RocksDB database

Usage

>>> import rocksdb
>>> from rocktrie import list_to_trie_db, lookup, ROW_KEY, TERMINAL_KEY, PAYLOAD_KEY
>>> db = rocksdb.DB('/tmp/trie1', rocksdb.Options(create_if_missing=True))
>>> list_to_trie_db([("CAT", 100), ("RAT", 200), ("DOG", 300)], db)
>>> lookup(db, 0, 0, "O")
>>> 
>>> lookup(db, 0, 0, "C")
[0, False, None]
>>> lookup(db, 0, 1, "A")
[0, False, None]
>>> lookup(db, 0, 2, "T")
[0, True, 100]
>>> 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rocktrie-0.0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rocktrie-0.0.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file rocktrie-0.0.1.tar.gz.

File metadata

  • Download URL: rocktrie-0.0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for rocktrie-0.0.1.tar.gz
Algorithm Hash digest
SHA256 44df77fe916031a6a7cc69a1a48cdabf13b87e0b2c536765f7c6e22a8ef59550
MD5 ea713e43f7d69320baee502bdbc0bba0
BLAKE2b-256 6d5a44b0063b02503908b4bdbc19f0333818b5d3357730f65e776382d6ab6551

See more details on using hashes here.

File details

Details for the file rocktrie-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: rocktrie-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for rocktrie-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 76dc25fb79a24c045b58c39becba72aa7d5d173855d6fc33efe2b266449a6e4d
MD5 1d566d9bd62077fc56f913057f79b9c6
BLAKE2b-256 c0311003aedcb6d927b148fb74260f2a164062fb3b55c0645dc5039dba65a173

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page