基于C&Python Bloomfilter的Memeroy | | Redis。
iron-man的Python项目详细描述
项目描述
Iron Man是一款基于Cython&C的bloom过滤器,它的设计目的是让用户快速轻松地开始使用,并能够扩展到复杂的应用程序。它最初是一个围绕Redis的简单实例。在
iromman提供了一些建议,但不强制执行任何依赖项或项目布局。由开发人员选择他们想要使用的工具和库。在
安装
使用pip安装和更新:
pip install -U iron-man
一个简单的例子
^{pr2}$Redis示例
fromiron_manimportRedisBloomFilterfromredisimportRedisredis_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 filterprint(lbf.is_contain("content"))# add item to filterlbf.add("content")print(lbf.is_contain("content"))# warning. normally, you don't need to clean BloomFilter.lbf.clean()
链接
- 发布:https://pypi.org/project/iron-man/
- 代码:http://gitlab.nuist.pro:3000/aberstone/IronMan.git
- 问题跟踪程序:http://gitlab.nuist.pro:3000/aberstone/IronMan/issues
- 项目
标签: