pyfusefilter 1.1.3__tar.gz → 1.2.0__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.3 → pyfusefilter-1.2.0}/PKG-INFO +3 -2
  2. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/README.md +1 -0
  3. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/pyfusefilter/__init__.py +1 -1
  4. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/pyfusefilter/pyfusefilter.py +32 -0
  5. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/pyfusefilter.egg-info/PKG-INFO +3 -2
  6. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/pyproject.toml +3 -3
  7. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/setup.py +1 -1
  8. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/tests/test_fuse16.py +1 -0
  9. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/tests/test_fuse8.py +1 -1
  10. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/tests/test_xor16.py +1 -0
  11. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/tests/test_xor8.py +1 -0
  12. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/LICENSE +0 -0
  13. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/MANIFEST.in +0 -0
  14. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/lib/xor_singleheader/include/binaryfusefilter.h +0 -0
  15. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/lib/xor_singleheader/include/xorfilter.h +0 -0
  16. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/pyfusefilter/ffibuild.py +0 -0
  17. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/pyfusefilter.egg-info/SOURCES.txt +0 -0
  18. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/pyfusefilter.egg-info/dependency_links.txt +0 -0
  19. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/pyfusefilter.egg-info/requires.txt +0 -0
  20. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/pyfusefilter.egg-info/top_level.txt +0 -0
  21. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/setup.cfg +0 -0
  22. {pyfusefilter-1.1.3 → pyfusefilter-1.2.0}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfusefilter
3
- Version: 1.1.3
3
+ Version: 1.2.0
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
@@ -207,7 +207,7 @@ License: Apache License
207
207
  See the License for the specific language governing permissions and
208
208
  limitations under the License.
209
209
 
210
- Project-URL: Homepage, https://github.com/glitzflitz/pyfusefilter
210
+ Project-URL: Homepage, https://github.com/FastFilter/pyfusefilter
211
211
  Requires-Python: >=3.0
212
212
  Description-Content-Type: text/markdown
213
213
  License-File: LICENSE
@@ -248,6 +248,7 @@ filter.contains("अ") # returns true
248
248
  # next returns true
249
249
  filter[51] #You can use __getitem__ instead of contains
250
250
  filter["か"] # returns false
251
+ 12.3 in filter # returns true
251
252
  ```
252
253
 
253
254
 
@@ -28,6 +28,7 @@ filter.contains("अ") # returns true
28
28
  # next returns true
29
29
  filter[51] #You can use __getitem__ instead of contains
30
30
  filter["か"] # returns false
31
+ 12.3 in filter # returns true
31
32
  ```
32
33
 
33
34
 
@@ -1,4 +1,4 @@
1
1
  from pyfusefilter.pyfusefilter import Xor8, Xor16, Fuse8, Fuse16
2
2
 
3
- VERSION = "1.1.3"
3
+ VERSION = "1.2.0"
4
4
  __all__ = ["Xor8", "Xor16", "Fuse8", "Fuse16"]
@@ -44,6 +44,14 @@ class Xor8:
44
44
  """
45
45
  return self.contains(item)
46
46
 
47
+ def __contains__(self, item):
48
+ """
49
+ Check if the item is in the filter. With a small probability, the filter
50
+ may return true for an item not in the set (false positive). There is
51
+ no false negative: if the filter returns false, the item is definitely not in the set.
52
+ """
53
+ return self.contains(item)
54
+
47
55
  def __del__(self):
48
56
  lib.xor8_free(self.__filter)
49
57
 
@@ -133,6 +141,14 @@ class Xor16:
133
141
  """
134
142
  return self.contains(item)
135
143
 
144
+ def __contains__(self, item):
145
+ """
146
+ Check if the item is in the filter. With a small probability, the filter
147
+ may return true for an item not in the set (false positive). There is
148
+ no false negative: if the filter returns false, the item is definitely not in the set.
149
+ """
150
+ return self.contains(item)
151
+
136
152
  def __del__(self):
137
153
  """
138
154
  Free the memory allocated for the Xor16 filter.
@@ -224,6 +240,14 @@ class Fuse8:
224
240
  """
225
241
  return self.contains(item)
226
242
 
243
+ def __contains__(self, item):
244
+ """
245
+ Check if the item is in the filter. With a small probability, the filter
246
+ may return true for an item not in the set (false positive). There is
247
+ no false negative: if the filter returns false, the item is definitely not in the set.
248
+ """
249
+ return self.contains(item)
250
+
227
251
  def __del__(self):
228
252
  """
229
253
  Free the memory allocated for the Fuse8 filter.
@@ -315,6 +339,14 @@ class Fuse16:
315
339
  """
316
340
  return self.contains(item)
317
341
 
342
+ def __contains__(self, item):
343
+ """
344
+ Check if the item is in the filter. With a small probability, the filter
345
+ may return true for an item not in the set (false positive). There is
346
+ no false negative: if the filter returns false, the item is definitely not in the set.
347
+ """
348
+ return self.contains(item)
349
+
318
350
  def __del__(self):
319
351
  """
320
352
  Free the memory allocated for the Fuse16 filter.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfusefilter
3
- Version: 1.1.3
3
+ Version: 1.2.0
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
@@ -207,7 +207,7 @@ License: Apache License
207
207
  See the License for the specific language governing permissions and
208
208
  limitations under the License.
209
209
 
210
- Project-URL: Homepage, https://github.com/glitzflitz/pyfusefilter
210
+ Project-URL: Homepage, https://github.com/FastFilter/pyfusefilter
211
211
  Requires-Python: >=3.0
212
212
  Description-Content-Type: text/markdown
213
213
  License-File: LICENSE
@@ -248,6 +248,7 @@ filter.contains("अ") # returns true
248
248
  # next returns true
249
249
  filter[51] #You can use __getitem__ instead of contains
250
250
  filter["か"] # returns false
251
+ 12.3 in filter # returns true
251
252
  ```
252
253
 
253
254
 
@@ -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.3"
6
+ version = "1.2.0"
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"},
@@ -15,7 +15,7 @@ license = {file = "LICENSE"}
15
15
  requires-python = ">=3.0"
16
16
 
17
17
  [project.urls]
18
- Homepage = "https://github.com/glitzflitz/pyfusefilter"
18
+ Homepage = "https://github.com/FastFilter/pyfusefilter"
19
19
 
20
20
  [build-system]
21
21
  requires = ["setuptools", "wheel", "cffi"]
@@ -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.3"
46
+ version = "1.2.0"
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.3",
6
+ version="1.2.0",
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",
@@ -9,6 +9,7 @@ def test_readme():
9
9
  assert filter.contains("अ") == True
10
10
  assert filter[51] #You can use __getitem__ instead of contains
11
11
  assert filter["か"] == False
12
+ assert 12.3 in filter #You can use __contains__ instead of contains
12
13
 
13
14
  def test_fuse16_int():
14
15
  xor_filter = Fuse16(50)
@@ -8,7 +8,7 @@ def test_readme():
8
8
  assert filter.contains("अ") == True
9
9
  assert filter[51] #You can use __getitem__ instead of contains
10
10
  assert filter["か"] == False
11
- assert filter.contains(150) == False
11
+ assert 12.3 in filter #You can use __contains__ instead of contains
12
12
 
13
13
  def test_fuse8_int():
14
14
  xor_filter = Fuse8(50)
@@ -8,6 +8,7 @@ def test_readme():
8
8
  assert filter.contains("अ") == True
9
9
  assert filter[51] #You can use __getitem__ instead of contains
10
10
  assert filter["か"] == False
11
+ assert 12.3 in filter #You can use __contains__ instead of contains
11
12
 
12
13
  def test_xor16_int():
13
14
  xor_filter = Xor16(100)
@@ -8,6 +8,7 @@ def test_readme():
8
8
  assert filter.contains("अ") == True
9
9
  assert filter[51] #You can use __getitem__ instead of contains
10
10
  assert filter["か"] == False
11
+ assert 12.3 in filter #You can use __contains__ instead of contains
11
12
 
12
13
  def test_xor8_int():
13
14
  xor_filter = Xor8(50)
File without changes
File without changes
File without changes