pip install usepy -U
- useAdDict
from usepy import useAdDict
d = useAdDict(
{'a': 1, 'b': 2, 'c': {'d': 3, 'e': 4}}
)
assert d.a == 1
assert d.c.e == 4
- useBloomFilter
from redis import Redis
from usepy import useBloomFilter
rds = Redis(host='localhost', port=6379, db=0)
bf = useBloomFilter(client=rds)
bf.add('hi', 'miclon')
assert bf.exists('hi') is True
assert bf.exists('miclon') is True
assert bf.exists('python') is False
更多参阅官方文档
欢迎提交PR,一起完善这个工具库。