Skip to content

Commit 03edc14

Browse files
committed
new version
1 parent eb95530 commit 03edc14

File tree

5 files changed

+28
-25
lines changed

5 files changed

+28
-25
lines changed

.github/workflows/wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ jobs:
6868
steps:
6969
- uses: actions/download-artifact@v4
7070
with:
71-
name: artifact
7271
path: dist
7372
merge-multiple: true
74-
73+
- name: List dist contents
74+
run: ls -l dist
7575
- uses: pypa/[email protected]
7676
with:
7777
user: __token__

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,36 @@ faster.
2121

2222

2323
```py
24-
>>> from pyfusefilter import Xor8, Xor16, Fuse8, Fuse16
25-
>>>
26-
>>> #Supports unicode strings and heterogeneous types
27-
>>> test_str = ["","", 51, 0.0, 12.3]
28-
>>> filter = Xor8(test_str)
29-
True
30-
>>> filter.contains("")
31-
True
32-
>>> filter[51] #You can use __getitem__ instead of contains
33-
True
34-
>>> filter[""]
35-
False
36-
>>> filter.size_in_bytes()
37-
60
24+
import pyfusefilter
25+
#Supports unicode strings and heterogeneous types
26+
filter = pyfusefilter.Xor8(["","", 51, 0.0, 12.3])
27+
filter.contains("") # returns true
28+
# next returns true
29+
filter[51] #You can use __getitem__ instead of contains
30+
filter[""] # returns false
3831
```
3932

4033

4134
The `size_in_bytes()` function gives the memory usage of the filter itself. It does not count
42-
the Python overhead which adds a few bytes to the actual memory usage.
35+
the Python overhead which adds a few bytes to the actual memory usage:
36+
37+
```py
38+
filter.size_in_bytes()
39+
```
4340

4441
You can serialize a filter with the `serialize()` method which returns a buffer, and you can recover the filter with the `deserialize(buffer)` method, which returns a filter:
4542

4643
```py
47-
> f = open('/tmp/output', 'wb')
48-
> f.write(filter.serialize())
49-
> f.close()
50-
> recoverfilter = Xor8.deserialize(open('/tmp/output', 'rb').read())
44+
import pyfusefilter
45+
import tempfile
46+
47+
filter = pyfusefilter.Xor8(["","", 51, 0.0, 12.3])
48+
with tempfile.NamedTemporaryFile(delete=False) as tmp:
49+
tmp.write(filter.serialize())
50+
tmp_path = tmp.name
51+
with open(tmp_path, 'rb') as f:
52+
recoverfilter = pyfusefilter.Xor8.deserialize(f.read())
53+
recoverfilter[51] # returns True
5154
```
5255

5356
The serialization format is as concise as possible and will typically use a few bytes

pyfusefilter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from pyfusefilter.pyfusefilter import Xor8, Xor16, Fuse8, Fuse16
22

3-
VERSION = "1.1.2"
3+
VERSION = "1.1.3"
44
__all__ = ["Xor8", "Xor16", "Fuse8", "Fuse16"]

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ py-modules = []
33
# cffi-modules handled in setup.py
44
[project]
55
name = "pyfusefilter"
6-
version = "1.1.2"
6+
version = "1.1.3"
77
description = "Python bindings for C implementation of xor and fuse filters"
88
authors = [
99
{name = "Amey Narkhede", email = "[email protected]"},
@@ -43,7 +43,7 @@ before-all = "apk add libffi-dev"
4343
# pdoc configuration
4444
name = "pyfusefilter"
4545
description = "Python bindings for C implementation of xor and fuse filters"
46-
version = "1.1.2"
46+
version = "1.1.3"
4747
author = "Amey Narkhede & Daniel Lemire"
4848
author_email = "[email protected]"
4949
url = "https://github.com/FastFilter/pyfusefilter"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="pyfusefilter",
6-
version="1.1.2",
6+
version="1.1.3",
77
description="Python bindings for C implementation of xorfilter",
88
long_description=open("README.md", "r", encoding='utf-8').read(),
99
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)