flow.record 3.21.dev15__tar.gz → 3.22.dev1__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.
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/PKG-INFO +2 -2
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/base.py +13 -11
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/fieldtypes/net/ip.py +1 -12
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/version.py +3 -3
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow.record.egg-info/PKG-INFO +2 -2
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow.record.egg-info/requires.txt +2 -2
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/pyproject.toml +2 -2
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/record/test_adapter.py +1 -3
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/.git-blame-ignore-revs +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/.gitattributes +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/COPYRIGHT +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/LICENSE +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/MANIFEST.in +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/README.md +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/examples/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/examples/filesystem.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/examples/passivedns.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/examples/records.json +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/examples/selectors.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/examples/tcpconn.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/archive.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/avro.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/broker.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/csvfile.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/duckdb.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/elastic.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/jsonfile.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/line.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/mongo.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/split.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/splunk.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/sqlite.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/stream.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/text.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/adapter/xlsx.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/context.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/exceptions.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/fieldtypes/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/fieldtypes/credential.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/fieldtypes/net/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/fieldtypes/net/ipv4.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/fieldtypes/net/tcp.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/fieldtypes/net/udp.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/jsonpacker.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/packer.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/selector.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/stream.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/tools/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/tools/geoip.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/tools/rdump.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/utils.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow/record/whitelist.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow.record.egg-info/SOURCES.txt +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow.record.egg-info/dependency_links.txt +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow.record.egg-info/entry_points.txt +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/flow.record.egg-info/top_level.txt +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/setup.cfg +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/_data/.gitkeep +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/_docs/Makefile +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/_docs/conf.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/_docs/index.rst +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/_utils.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/test_avro.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/test_csv.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/test_elastic.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/test_json.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/test_line.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/test_splunk.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/test_sqlite_duckdb.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/test_text.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/adapter/test_xlsx.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/conftest.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/fieldtypes/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/fieldtypes/test_fieldtypes.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/fieldtypes/test_ip.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/packer/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/packer/test_json_packer.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/packer/test_packer.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/record/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/record/test_context.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/record/test_descriptor.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/record/test_multi_timestamp.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/record/test_record.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/selector/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/selector/test_compiled.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/selector/test_selectors.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/test_deprecations.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/test_regressions.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/test_utils.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/tools/__init__.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tests/tools/test_rdump.py +0 -0
- {flow_record-3.21.dev15 → flow_record-3.22.dev1}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flow.record
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.22.dev1
|
|
4
4
|
Summary: A library for defining and creating structured data (called records) that can be streamed to disk or piped to other tools that use flow.record
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -23,7 +23,7 @@ Requires-Dist: msgpack>=0.5.2
|
|
|
23
23
|
Requires-Dist: tzdata; platform_system == "Windows"
|
|
24
24
|
Provides-Extra: compression
|
|
25
25
|
Requires-Dist: lz4; extra == "compression"
|
|
26
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: backports.zstd; python_version < "3.14" and extra == "compression"
|
|
27
27
|
Provides-Extra: elastic
|
|
28
28
|
Requires-Dist: elasticsearch; extra == "elastic"
|
|
29
29
|
Provides-Extra: geoip
|
|
@@ -27,25 +27,33 @@ from urllib.parse import parse_qsl, urlparse
|
|
|
27
27
|
from flow.record.exceptions import RecordAdapterNotFound, RecordDescriptorError
|
|
28
28
|
from flow.record.utils import get_stdin, get_stdout
|
|
29
29
|
|
|
30
|
+
# lz4
|
|
30
31
|
try:
|
|
31
32
|
import lz4.frame as lz4
|
|
32
33
|
|
|
33
34
|
HAS_LZ4 = True
|
|
34
35
|
except ImportError:
|
|
35
36
|
HAS_LZ4 = False
|
|
37
|
+
|
|
38
|
+
# bzip2
|
|
36
39
|
try:
|
|
37
40
|
import bz2
|
|
38
41
|
|
|
39
42
|
HAS_BZ2 = True
|
|
40
43
|
except ImportError:
|
|
41
44
|
HAS_BZ2 = False
|
|
42
|
-
try:
|
|
43
|
-
import zstandard as zstd
|
|
44
45
|
|
|
46
|
+
# zstandard
|
|
47
|
+
try:
|
|
48
|
+
if sys.version_info >= (3, 14):
|
|
49
|
+
from compression import zstd # novermin
|
|
50
|
+
else:
|
|
51
|
+
from backports import zstd
|
|
45
52
|
HAS_ZSTD = True
|
|
46
53
|
except ImportError:
|
|
47
54
|
HAS_ZSTD = False
|
|
48
55
|
|
|
56
|
+
# fastavro
|
|
49
57
|
try:
|
|
50
58
|
import fastavro as avro # noqa
|
|
51
59
|
|
|
@@ -727,8 +735,7 @@ def open_stream(fp: BinaryIO, mode: str) -> BinaryIO:
|
|
|
727
735
|
elif HAS_LZ4 and peek_data[:4] == LZ4_MAGIC:
|
|
728
736
|
fp = lz4.open(fp, mode=mode)
|
|
729
737
|
elif HAS_ZSTD and peek_data[:4] == ZSTD_MAGIC:
|
|
730
|
-
|
|
731
|
-
fp = dctx.stream_reader(fp)
|
|
738
|
+
fp = zstd.ZstdFile(fp, mode=mode)
|
|
732
739
|
|
|
733
740
|
return fp
|
|
734
741
|
|
|
@@ -804,13 +811,8 @@ def open_path(path: str, mode: str, clobber: bool = True) -> IO:
|
|
|
804
811
|
fp = lz4.open(path, mode)
|
|
805
812
|
elif path.endswith((".zstd", ".zst")):
|
|
806
813
|
if not HAS_ZSTD:
|
|
807
|
-
raise RuntimeError("
|
|
808
|
-
|
|
809
|
-
dctx = zstd.ZstdDecompressor()
|
|
810
|
-
fp = dctx.stream_reader(pathobj.open("rb"))
|
|
811
|
-
else:
|
|
812
|
-
cctx = zstd.ZstdCompressor()
|
|
813
|
-
fp = cctx.stream_writer(pathobj.open("wb"))
|
|
814
|
+
raise RuntimeError("backports.zstd python module not available")
|
|
815
|
+
fp = zstd.ZstdFile(path, mode)
|
|
814
816
|
|
|
815
817
|
# normal file or stdio for reading or writing
|
|
816
818
|
if not fp:
|
|
@@ -73,20 +73,9 @@ class ipnetwork(FieldType):
|
|
|
73
73
|
def __hash__(self) -> int:
|
|
74
74
|
return hash(self.val)
|
|
75
75
|
|
|
76
|
-
@staticmethod
|
|
77
|
-
def _is_subnet_of(a: _IPNetwork, b: _IPNetwork) -> bool:
|
|
78
|
-
try:
|
|
79
|
-
# Always false if one is v4 and the other is v6.
|
|
80
|
-
if a._version != b._version:
|
|
81
|
-
raise TypeError(f"{a} and {b} are not of the same version")
|
|
82
|
-
except AttributeError:
|
|
83
|
-
raise TypeError(f"Unable to test subnet containment between {a} and {b}")
|
|
84
|
-
else:
|
|
85
|
-
return b.network_address <= a.network_address and b.broadcast_address >= a.broadcast_address
|
|
86
|
-
|
|
87
76
|
def __contains__(self, b: object) -> bool:
|
|
88
77
|
try:
|
|
89
|
-
return
|
|
78
|
+
return ip_network(b).subnet_of(self.val)
|
|
90
79
|
except (ValueError, TypeError):
|
|
91
80
|
return False
|
|
92
81
|
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '3.
|
|
32
|
-
__version_tuple__ = version_tuple = (3,
|
|
31
|
+
__version__ = version = '3.22.dev1'
|
|
32
|
+
__version_tuple__ = version_tuple = (3, 22, 'dev1')
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'gf3a1c5fa4'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flow.record
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.22.dev1
|
|
4
4
|
Summary: A library for defining and creating structured data (called records) that can be streamed to disk or piped to other tools that use flow.record
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -23,7 +23,7 @@ Requires-Dist: msgpack>=0.5.2
|
|
|
23
23
|
Requires-Dist: tzdata; platform_system == "Windows"
|
|
24
24
|
Provides-Extra: compression
|
|
25
25
|
Requires-Dist: lz4; extra == "compression"
|
|
26
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: backports.zstd; python_version < "3.14" and extra == "compression"
|
|
27
27
|
Provides-Extra: elastic
|
|
28
28
|
Requires-Dist: elasticsearch; extra == "elastic"
|
|
29
29
|
Provides-Extra: geoip
|
|
@@ -37,7 +37,7 @@ repository = "https://github.com/fox-it/flow.record"
|
|
|
37
37
|
# Note: these compression libraries do not work well with pypy
|
|
38
38
|
compression = [
|
|
39
39
|
"lz4",
|
|
40
|
-
"
|
|
40
|
+
"backports.zstd; python_version < '3.14'",
|
|
41
41
|
]
|
|
42
42
|
elastic = [
|
|
43
43
|
"elasticsearch",
|
|
@@ -68,7 +68,7 @@ full = [
|
|
|
68
68
|
[dependency-groups]
|
|
69
69
|
compression = [
|
|
70
70
|
"lz4",
|
|
71
|
-
"
|
|
71
|
+
"backports.zstd; python_version < '3.14'",
|
|
72
72
|
]
|
|
73
73
|
elastic = [
|
|
74
74
|
"elasticsearch",
|
|
@@ -85,12 +85,10 @@ def test_compressed_writer_reader(tmp_path: Path, compression: str) -> None:
|
|
|
85
85
|
if compression == "lz4" and not HAS_LZ4:
|
|
86
86
|
pytest.skip("lz4 module not installed")
|
|
87
87
|
if compression == "zstd" and not HAS_ZSTD:
|
|
88
|
-
pytest.skip("
|
|
88
|
+
pytest.skip("backports.zstd module not installed")
|
|
89
89
|
|
|
90
90
|
if compression == "lz4" and platform.python_implementation() == "PyPy":
|
|
91
91
|
pytest.skip("lz4 module not supported on PyPy")
|
|
92
|
-
if compression == "zstd" and platform.python_implementation() == "PyPy":
|
|
93
|
-
pytest.skip("zstandard module not supported on PyPy")
|
|
94
92
|
|
|
95
93
|
p = tmp_path.joinpath(f"{compression}-test")
|
|
96
94
|
p.mkdir()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|