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.

Files for iron-man, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size iron_man-1.0.3-cp38-cp38-macosx_10_9_x86_64.whl (24.0 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size iron_man-1.0.3.tar.gz (6.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page