FastWARC 1.0.3__tar.gz → 1.0.4__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 (53) hide show
  1. {fastwarc-1.0.3 → fastwarc-1.0.4}/FastWARC.egg-info/PKG-INFO +3 -2
  2. {fastwarc-1.0.3 → fastwarc-1.0.4}/FastWARC.egg-info/requires.txt +3 -0
  3. {fastwarc-1.0.3 → fastwarc-1.0.4}/PKG-INFO +3 -2
  4. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/_shims.py +21 -12
  5. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/warc.pyi +16 -10
  6. {fastwarc-1.0.3 → fastwarc-1.0.4}/pyproject.toml +4 -3
  7. {fastwarc-1.0.3 → fastwarc-1.0.4}/FastWARC.egg-info/SOURCES.txt +0 -0
  8. {fastwarc-1.0.3 → fastwarc-1.0.4}/FastWARC.egg-info/dependency_links.txt +0 -0
  9. {fastwarc-1.0.3 → fastwarc-1.0.4}/FastWARC.egg-info/entry_points.txt +0 -0
  10. {fastwarc-1.0.3 → fastwarc-1.0.4}/FastWARC.egg-info/top_level.txt +0 -0
  11. {fastwarc-1.0.3 → fastwarc-1.0.4}/MANIFEST.in +0 -0
  12. {fastwarc-1.0.3 → fastwarc-1.0.4}/README.md +0 -0
  13. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/__init__.py +0 -0
  14. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/__init__.pyi +0 -0
  15. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/cli.py +0 -0
  16. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/__init__.pxd +0 -0
  17. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/__init__.py +0 -0
  18. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/__init__.pyi +0 -0
  19. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/stream_io.pxd +0 -0
  20. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/stream_io.pyi +0 -0
  21. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/stream_io.pyx +0 -0
  22. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/tools.pyi +0 -0
  23. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/tools.pyx +0 -0
  24. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/warc.pxd +0 -0
  25. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/warc.pyi +0 -0
  26. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/legacy/warc.pyx +0 -0
  27. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/py.typed +0 -0
  28. {fastwarc-1.0.3 → fastwarc-1.0.4}/fastwarc/stream_io.pyi +0 -0
  29. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_common/__init__.pxd +0 -0
  30. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_common/string_util.pxd +0 -0
  31. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/__init__.pxd +0 -0
  32. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/algorithm.pxd +0 -0
  33. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/atomic.pxd +0 -0
  34. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/boost_regex.pxd +0 -0
  35. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/cctype.pxd +0 -0
  36. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/cstdlib.pxd +0 -0
  37. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/cstring.pxd +0 -0
  38. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/dlfcn.pxd +0 -0
  39. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/errno.pxd +0 -0
  40. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/lexbor.pxd +0 -0
  41. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/lz4frame.pxd +0 -0
  42. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/lz4hc.pxd +0 -0
  43. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/pthread.pxd +0 -0
  44. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/re2.pxd +0 -0
  45. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/stdio.pxd +0 -0
  46. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/string_view.pxd +0 -0
  47. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/time.pxd +0 -0
  48. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/uchardet.pxd +0 -0
  49. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/unistd.pxd +0 -0
  50. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/utility.pxd +0 -0
  51. {fastwarc-1.0.3 → fastwarc-1.0.4}/resiliparse_inc/zlib.pxd +0 -0
  52. {fastwarc-1.0.3 → fastwarc-1.0.4}/setup.cfg +0 -0
  53. {fastwarc-1.0.3 → fastwarc-1.0.4}/setup.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: FastWARC
3
- Version: 1.0.3
4
- Summary: A high-performance WARC parsing library written in Rust with bindings for Python.
3
+ Version: 1.0.4
4
+ Summary: The world's fastest WARC parsing library written in Rust with bindings for Python.
5
5
  Author: Janek Bevendorff
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: repository, https://github.com/chatnoir-eu/chatnoir-resiliparse
@@ -12,6 +12,7 @@ Description-Content-Type: text/markdown
12
12
  Requires-Dist: brotli
13
13
  Requires-Dist: click
14
14
  Requires-Dist: tqdm
15
+ Requires-Dist: typing_extensions>=4.5; python_version < "3.13"
15
16
  Provides-Extra: all
16
17
  Requires-Dist: fastwarc[fsspec]; extra == "all"
17
18
  Provides-Extra: fsspec
@@ -2,6 +2,9 @@ brotli
2
2
  click
3
3
  tqdm
4
4
 
5
+ [:python_version < "3.13"]
6
+ typing_extensions>=4.5
7
+
5
8
  [all]
6
9
  fastwarc[fsspec]
7
10
 
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: FastWARC
3
- Version: 1.0.3
4
- Summary: A high-performance WARC parsing library written in Rust with bindings for Python.
3
+ Version: 1.0.4
4
+ Summary: The world's fastest WARC parsing library written in Rust with bindings for Python.
5
5
  Author: Janek Bevendorff
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: repository, https://github.com/chatnoir-eu/chatnoir-resiliparse
@@ -12,6 +12,7 @@ Description-Content-Type: text/markdown
12
12
  Requires-Dist: brotli
13
13
  Requires-Dist: click
14
14
  Requires-Dist: tqdm
15
+ Requires-Dist: typing_extensions>=4.5; python_version < "3.13"
15
16
  Provides-Extra: all
16
17
  Requires-Dist: fastwarc[fsspec]; extra == "all"
17
18
  Provides-Extra: fsspec
@@ -14,7 +14,10 @@
14
14
 
15
15
  # Legacy shims for making the new Rust extension work with the old type names
16
16
 
17
- import warnings
17
+ try:
18
+ from warnings import deprecated
19
+ except ImportError:
20
+ from typing_extensions import deprecated
18
21
 
19
22
  __all__ = [
20
23
  'wrap_stream',
@@ -32,19 +35,21 @@ __all__ = [
32
35
  'ReaderStaleError',
33
36
  ]
34
37
 
35
- FastWARCError = OSError
36
38
 
37
- StreamError = OSError
39
+ @deprecated("Use OSError instead.", category=FutureWarning)
40
+ class FastWARCError(OSError): ...
38
41
 
39
- ReaderStaleError = OSError
40
42
 
43
+ @deprecated("Use OSError instead.", category=FutureWarning)
44
+ class StreamError(OSError): ...
41
45
 
42
- def _warn_deprecated(msg):
43
- warnings.warn(msg, FutureWarning, 3)
44
46
 
47
+ @deprecated("Use OSError instead.", category=FutureWarning)
48
+ class ReaderStaleError(OSError): ...
45
49
 
50
+
51
+ @deprecated("wrap_stream is deprecated and will be removed in a future version.", category=FutureWarning)
46
52
  def wrap_stream(raw_stream, mode='rb', fsspec_args=None):
47
- _warn_deprecated("wrap_stream is deprecated and will be removed in a future version.")
48
53
  if isinstance(raw_stream, str):
49
54
  if fsspec_args is not False and '://' in raw_stream:
50
55
  try:
@@ -57,9 +62,9 @@ def wrap_stream(raw_stream, mode='rb', fsspec_args=None):
57
62
  return raw_stream
58
63
 
59
64
 
65
+ @deprecated("BufferedReader is deprecated and will be removed in a future version.", category=FutureWarning)
60
66
  class BufferedReader:
61
67
  def __init__(self, stream, *args, **kwargs):
62
- _warn_deprecated("BufferedReader is deprecated and will be removed in a future version.")
63
68
  self._stream = stream
64
69
 
65
70
  def close(self):
@@ -78,12 +83,9 @@ class BufferedReader:
78
83
  return self._stream.tell()
79
84
 
80
85
 
86
+ @deprecated("Use the new Reader and Writer classes from stream_io instead.", category=FutureWarning)
81
87
  class IOStream:
82
88
  def __init__(self, *_, _reader_factory=None, _writer_factory=None, **__):
83
- _warn_deprecated(
84
- f"{self.__class__.__name__} is deprecated and will be removed in a future version. "
85
- "Use the new Reader and Writer classes from stream_io instead.")
86
-
87
89
  self._reader_factory = _reader_factory
88
90
  self._writer_factory = _writer_factory
89
91
  self._reader = None
@@ -140,6 +142,7 @@ class IOStream:
140
142
  s.close()
141
143
 
142
144
 
145
+ @deprecated("Use the new Reader and Writer classes from stream_io instead.", category=FutureWarning)
143
146
  class CompressingStream(IOStream):
144
147
  def begin_member(self):
145
148
  pass
@@ -149,12 +152,14 @@ class CompressingStream(IOStream):
149
152
  self._writer = None
150
153
 
151
154
 
155
+ @deprecated("Use the plain Python stream object without any wrapper.", category=FutureWarning)
152
156
  class PythonIOStreamAdapter:
153
157
  def __new__(cls, py_stream):
154
158
  return IOStream(_reader_factory=lambda: py_stream,
155
159
  _writer_factory=lambda: py_stream)
156
160
 
157
161
 
162
+ @deprecated("Use plain file paths instead.", category=FutureWarning)
158
163
  class FileStream:
159
164
  def __new__(cls, filename: str, mode: str = 'rb'):
160
165
  if 'b' not in mode:
@@ -163,6 +168,7 @@ class FileStream:
163
168
  return IOStream(_reader_factory=lambda: f, _writer_factory=lambda: f)
164
169
 
165
170
 
171
+ @deprecated("Use io.BytesIO instead.", category=FutureWarning)
166
172
  class BytesIOStream:
167
173
  def __new__(cls, initial_data=None):
168
174
  import io
@@ -170,6 +176,7 @@ class BytesIOStream:
170
176
  return IOStream(_reader_factory=lambda: bio, _writer_factory=lambda: bio)
171
177
 
172
178
 
179
+ @deprecated("Use the new GzipReader and GzipWriter classes from stream_io instead.", category=FutureWarning)
173
180
  class GZipStream:
174
181
  def __new__(cls, raw_stream, compression_level=9, zlib=False, fsspec_args=None):
175
182
  from ..stream_io import GzipReader, GzipWriter
@@ -181,6 +188,7 @@ class GZipStream:
181
188
  return stream
182
189
 
183
190
 
191
+ @deprecated("Use the new Lz4Reader and Lz4Writer classes from stream_io instead.", category=FutureWarning)
184
192
  class LZ4Stream:
185
193
  def __new__(cls, raw_stream, mode='r', compression_level=12,
186
194
  favor_dec_speed=True, fsspec_args=None):
@@ -192,6 +200,7 @@ class LZ4Stream:
192
200
  return stream
193
201
 
194
202
 
203
+ @deprecated("Use the new BrotliReader and BrotliWriter classes from stream_io instead.", category=FutureWarning)
195
204
  class BrotliStream:
196
205
  def __new__(cls, raw_stream, quality=11, lgwin=22, lgblock=0, fsspec_args=None):
197
206
  from ..stream_io import BrotliReader, BrotliWriter
@@ -16,7 +16,7 @@ from datetime import datetime
16
16
  from collections.abc import Callable, Iterable, Iterator
17
17
  from enum import IntFlag
18
18
  from typing import BinaryIO, final, Literal, Self
19
- from typing_extensions import disjoint_base
19
+ from typing_extensions import deprecated, disjoint_base
20
20
 
21
21
  from .stream_io import _GenericReader, _GenericWriter, _ReaderInput, WarcReader, WarcWriter
22
22
 
@@ -95,8 +95,7 @@ no_type = WarcRecordType.no_type
95
95
  any_type = WarcRecordType.any_type
96
96
 
97
97
 
98
- @final
99
- class HeaderMap:
98
+ class _HeaderMap:
100
99
  def __new__(cls, encoding: str = "utf-8") -> Self: ...
101
100
 
102
101
  @property
@@ -127,12 +126,12 @@ class HeaderMap:
127
126
 
128
127
  def to_dict(self) -> dict[str, str]: ...
129
128
 
130
- # deprecated
129
+ @deprecated("Use to_dict() instead.")
131
130
  def asdict(self) -> dict[str, str]: ...
132
131
 
133
132
  def to_tuples(self) -> tuple[tuple[str, str], ...]: ...
134
133
 
135
- # deprecated
134
+ @deprecated("Use to_tuples() instead.")
136
135
  def astuples(self) -> tuple[tuple[str, str], ...]: ...
137
136
 
138
137
  def is_empty(self) -> bool: ...
@@ -198,8 +197,13 @@ class HeaderMap:
198
197
  def __setstate__(self, state: tuple[bytes, bool]): ...
199
198
 
200
199
 
201
- # Legacy name
202
- WarcHeaderMap = HeaderMap
200
+ @final
201
+ class HeaderMap(_HeaderMap): ...
202
+
203
+
204
+ @deprecated("Use HeaderMap instead.")
205
+ @final
206
+ class WarcHeaderMap(_HeaderMap): ...
203
207
 
204
208
 
205
209
  @final
@@ -287,10 +291,10 @@ class WarcRecord:
287
291
 
288
292
  def consume(self, n: int | None = None) -> int: ...
289
293
 
290
- def parse_warc_headers(self, quirks_mode: bool = False) -> int: ...
294
+ def parse_warc_headers(self, quirks_mode: bool = False, max_header_len: int = 32 << 10) -> int: ...
291
295
 
292
- def parse_http(self, auto_decode: Literal['none', 'content', 'transfer', 'all'] = 'none', *,
293
- strict_mode: bool = True): ...
296
+ def parse_http(self, auto_decode: Literal['none', 'content', 'transfer', 'all'] = 'none',
297
+ max_header_len: int = 32 << 10, quirks_mode: bool = False, *, strict_mode: bool = True): ...
294
298
 
295
299
  def verify_block_digest(self, consume: bool = False) -> bool: ...
296
300
 
@@ -332,8 +336,10 @@ class ArchiveIterator(Iterable[WarcRecord]):
332
336
  verify_digests: bool = False,
333
337
  quirks_mode: bool = False,
334
338
  auto_decode: Literal['none', 'content', 'transfer', 'all'] = 'none',
339
+ max_header_len: int = 32 << 10,
335
340
  stream_detect: bool = True,
336
341
  buffer_size: int = 64 << 10,
342
+ inplace: bool = False,
337
343
  fsspec_args=None,
338
344
  *,
339
345
  strict_mode: bool = True
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "FastWARC"
7
- version = "1.0.3"
8
- description = "A high-performance WARC parsing library written in Rust with bindings for Python."
7
+ version = "1.0.4"
8
+ description = "The world's fastest WARC parsing library written in Rust with bindings for Python."
9
9
  authors = [
10
10
  { name = "Janek Bevendorff" }
11
11
  ]
@@ -15,7 +15,8 @@ requires-python = ">=3.10"
15
15
  dependencies = [
16
16
  "brotli",
17
17
  "click",
18
- "tqdm"
18
+ "tqdm",
19
+ "typing_extensions>=4.5; python_version < '3.13'",
19
20
  ]
20
21
 
21
22
  [project.urls]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes