{ "info": { "author": "Aberstone", "author_email": "aberstone.hk@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: C", "Programming Language :: Cython", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Project description\n\nIron-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.\n\nIrom-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.\n\n\n# Installing\n\nInstall and update using pip:\n```bash\npip install -U iron-man\n```\n\n\n# A Simple Example\n```python\nfrom iron_man import LocalBloomFilter\n\nlbf = LocalBloomFilter(capacity=10000,error=0.0001)\n\n# check item is it in filter\nprint(lbf.is_contain(\"content\"))\n\n# add item to filter\nlbf.add(\"content\")\nprint(lbf.is_contain(\"content\"))\n```\n\n# A Redis Example\n```python\nfrom iron_man import RedisBloomFilter\nfrom redis import Redis\n\nredis_conn:Redis = Redis()\n\nlbf = RedisBloomFilter(capacity=100000000,error=0.0001,redis_conn=redis_conn,prime_length=True,filter_prefix=\"bf_test\")\n# show the how many string will used by redis.\n# every string will use 512MB mem.\nprint(lbf.mem_block_counts) \n# check item is it in filter\nprint(lbf.is_contain(\"content\"))\n\n# add item to filter\nlbf.add(\"content\")\nprint(lbf.is_contain(\"content\"))\n\n# warning. normally, you don't need to clean BloomFilter.\nlbf.clean() \n```\n\n# Links\n