Skip to main content

C & Python Bloomfilter Based Memeroy || Redis .

Project description

Project description

Iron-Man is a bloom filter based Cython & C. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple Instance around Redis.

Irom-Man offers suggestions, but doesn't enforce any dependencies or project layout. It is up to the developer to choose the tools and libraries they want to use.

Installing

Install and update using pip:

pip install -U iron-man

A Simple Example

from iron_man import LocalBloomFilter

lbf = LocalBloomFilter(capacity=10000,error=0.0001)

# check item is it in filter
print(lbf.is_contain("content"))

# add item to filter
lbf.add("content")
print(lbf.is_contain("content"))

A Redis Example

from iron_man import RedisBloomFilter
from redis import Redis

redis_conn:Redis = Redis()

lbf = RedisBloomFilter(capacity=100000000,error=0.0001,redis_conn=redis_conn,prime_length=True,filter_prefix="bf_test")
# show the how many string will used by redis.
# every string will use 512MB mem.
print(lbf.mem_block_counts) 
# check item is it in filter
print(lbf.is_contain("content"))

# add item to filter
lbf.add("content")
print(lbf.is_contain("content"))

# warning. normally, you don't need to clean BloomFilter.
lbf.clean() 

Links

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

iron_man-1.0.2.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

iron_man-1.0.2-cp38-cp38-macosx_10_9_x86_64.whl (24.0 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

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