pyfusefilter 1.1.2__tar.gz → 1.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/PKG-INFO +23 -20
  2. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/README.md +22 -19
  3. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/pyfusefilter/__init__.py +1 -1
  4. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/pyfusefilter.egg-info/PKG-INFO +23 -20
  5. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/pyproject.toml +2 -2
  6. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/setup.py +1 -1
  7. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/LICENSE +0 -0
  8. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/MANIFEST.in +0 -0
  9. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/lib/xor_singleheader/include/binaryfusefilter.h +0 -0
  10. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/lib/xor_singleheader/include/xorfilter.h +0 -0
  11. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/pyfusefilter/ffibuild.py +0 -0
  12. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/pyfusefilter/pyfusefilter.py +0 -0
  13. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/pyfusefilter.egg-info/SOURCES.txt +0 -0
  14. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/pyfusefilter.egg-info/dependency_links.txt +0 -0
  15. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/pyfusefilter.egg-info/requires.txt +0 -0
  16. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/pyfusefilter.egg-info/top_level.txt +0 -0
  17. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/setup.cfg +0 -0
  18. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/tests/__init__.py +0 -0
  19. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/tests/test_fuse16.py +0 -0
  20. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/tests/test_fuse8.py +0 -0
  21. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/tests/test_xor16.py +0 -0
  22. {pyfusefilter-1.1.2 → pyfusefilter-1.1.3}/tests/test_xor8.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfusefilter
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: Python bindings for C implementation of xor and fuse filters
5
5
  Home-page: https://github.com/FastFilter/pyfusefilter
6
6
  Author: Amey Narkhede & Daniel Lemire
@@ -241,33 +241,36 @@ faster.
241
241
 
242
242
 
243
243
  ```py
244
- >>> from pyfusefilter import Xor8, Xor16, Fuse8, Fuse16
245
- >>>
246
- >>> #Supports unicode strings and heterogeneous types
247
- >>> test_str = ["あ","अ", 51, 0.0, 12.3]
248
- >>> filter = Xor8(test_str)
249
- True
250
- >>> filter.contains("अ")
251
- True
252
- >>> filter[51] #You can use __getitem__ instead of contains
253
- True
254
- >>> filter["か"]
255
- False
256
- >>> filter.size_in_bytes()
257
- 60
244
+ import pyfusefilter
245
+ #Supports unicode strings and heterogeneous types
246
+ filter = pyfusefilter.Xor8(["あ","अ", 51, 0.0, 12.3])
247
+ filter.contains("अ") # returns true
248
+ # next returns true
249
+ filter[51] #You can use __getitem__ instead of contains
250
+ filter["か"] # returns false
258
251
  ```
259
252
 
260
253
 
261
254
  The `size_in_bytes()` function gives the memory usage of the filter itself. It does not count
262
- the Python overhead which adds a few bytes to the actual memory usage.
255
+ the Python overhead which adds a few bytes to the actual memory usage:
256
+
257
+ ```py
258
+ filter.size_in_bytes()
259
+ ```
263
260
 
264
261
  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:
265
262
 
266
263
  ```py
267
- > f = open('/tmp/output', 'wb')
268
- > f.write(filter.serialize())
269
- > f.close()
270
- > recoverfilter = Xor8.deserialize(open('/tmp/output', 'rb').read())
264
+ import pyfusefilter
265
+ import tempfile
266
+
267
+ filter = pyfusefilter.Xor8(["あ","अ", 51, 0.0, 12.3])
268
+ with tempfile.NamedTemporaryFile(delete=False) as tmp:
269
+ tmp.write(filter.serialize())
270
+ tmp_path = tmp.name
271
+ with open(tmp_path, 'rb') as f:
272
+ recoverfilter = pyfusefilter.Xor8.deserialize(f.read())
273
+ recoverfilter[51] # returns True
271
274
  ```
272
275
 
273
276
  The serialization format is as concise as possible and will typically use a few bytes
@@ -21,33 +21,36 @@ faster.
21
21
 
22
22
 
23
23
  ```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
38
31
  ```
39
32
 
40
33
 
41
34
  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
+ ```
43
40
 
44
41
  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:
45
42
 
46
43
  ```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
51
54
  ```
52
55
 
53
56
  The serialization format is as concise as possible and will typically use a few bytes
@@ -1,4 +1,4 @@
1
1
  from pyfusefilter.pyfusefilter import Xor8, Xor16, Fuse8, Fuse16
2
2
 
3
- VERSION = "1.1.2"
3
+ VERSION = "1.1.3"
4
4
  __all__ = ["Xor8", "Xor16", "Fuse8", "Fuse16"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfusefilter
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: Python bindings for C implementation of xor and fuse filters
5
5
  Home-page: https://github.com/FastFilter/pyfusefilter
6
6
  Author: Amey Narkhede & Daniel Lemire
@@ -241,33 +241,36 @@ faster.
241
241
 
242
242
 
243
243
  ```py
244
- >>> from pyfusefilter import Xor8, Xor16, Fuse8, Fuse16
245
- >>>
246
- >>> #Supports unicode strings and heterogeneous types
247
- >>> test_str = ["あ","अ", 51, 0.0, 12.3]
248
- >>> filter = Xor8(test_str)
249
- True
250
- >>> filter.contains("अ")
251
- True
252
- >>> filter[51] #You can use __getitem__ instead of contains
253
- True
254
- >>> filter["か"]
255
- False
256
- >>> filter.size_in_bytes()
257
- 60
244
+ import pyfusefilter
245
+ #Supports unicode strings and heterogeneous types
246
+ filter = pyfusefilter.Xor8(["あ","अ", 51, 0.0, 12.3])
247
+ filter.contains("अ") # returns true
248
+ # next returns true
249
+ filter[51] #You can use __getitem__ instead of contains
250
+ filter["か"] # returns false
258
251
  ```
259
252
 
260
253
 
261
254
  The `size_in_bytes()` function gives the memory usage of the filter itself. It does not count
262
- the Python overhead which adds a few bytes to the actual memory usage.
255
+ the Python overhead which adds a few bytes to the actual memory usage:
256
+
257
+ ```py
258
+ filter.size_in_bytes()
259
+ ```
263
260
 
264
261
  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:
265
262
 
266
263
  ```py
267
- > f = open('/tmp/output', 'wb')
268
- > f.write(filter.serialize())
269
- > f.close()
270
- > recoverfilter = Xor8.deserialize(open('/tmp/output', 'rb').read())
264
+ import pyfusefilter
265
+ import tempfile
266
+
267
+ filter = pyfusefilter.Xor8(["あ","अ", 51, 0.0, 12.3])
268
+ with tempfile.NamedTemporaryFile(delete=False) as tmp:
269
+ tmp.write(filter.serialize())
270
+ tmp_path = tmp.name
271
+ with open(tmp_path, 'rb') as f:
272
+ recoverfilter = pyfusefilter.Xor8.deserialize(f.read())
273
+ recoverfilter[51] # returns True
271
274
  ```
272
275
 
273
276
  The serialization format is as concise as possible and will typically use a few bytes
@@ -3,7 +3,7 @@ py-modules = []
3
3
  # cffi-modules handled in setup.py
4
4
  [project]
5
5
  name = "pyfusefilter"
6
- version = "1.1.2"
6
+ version = "1.1.3"
7
7
  description = "Python bindings for C implementation of xor and fuse filters"
8
8
  authors = [
9
9
  {name = "Amey Narkhede", email = "ameynarkhede02@gmail.com"},
@@ -43,7 +43,7 @@ before-all = "apk add libffi-dev"
43
43
  # pdoc configuration
44
44
  name = "pyfusefilter"
45
45
  description = "Python bindings for C implementation of xor and fuse filters"
46
- version = "1.1.2"
46
+ version = "1.1.3"
47
47
  author = "Amey Narkhede & Daniel Lemire"
48
48
  author_email = "daniel@lemire.me"
49
49
  url = "https://github.com/FastFilter/pyfusefilter"
@@ -3,7 +3,7 @@ import os
3
3
 
4
4
  setup(
5
5
  name="pyfusefilter",
6
- version="1.1.2",
6
+ version="1.1.3",
7
7
  description="Python bindings for C implementation of xorfilter",
8
8
  long_description=open("README.md", "r", encoding='utf-8').read(),
9
9
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes