python-rayhunter 2025.3.1__tar.gz → 2026.3.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-rayhunter
3
- Version: 2025.3.1
3
+ Version: 2026.3.2
4
4
  Summary: Unofficial Python bindings for EFF's Rayhunter API
5
5
  Author-email: UltraSunshine <python-rayhunter.hedge098@passfwd.com>
6
6
  Maintainer-email: UltraSunshine <python-rayhunter.hedge098@passfwd.com>
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "python-rayhunter"
3
3
 
4
- version = "2025.3.1"
4
+ version = "2026.3.2"
5
5
  requires-python = ">=3.11"
6
6
 
7
7
  authors = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-rayhunter
3
- Version: 2025.3.1
3
+ Version: 2026.3.2
4
4
  Summary: Unofficial Python bindings for EFF's Rayhunter API
5
5
  Author-email: UltraSunshine <python-rayhunter.hedge098@passfwd.com>
6
6
  Maintainer-email: UltraSunshine <python-rayhunter.hedge098@passfwd.com>
@@ -13,7 +13,8 @@ class RayhunterApi:
13
13
  def active_recording(self) -> bool:
14
14
  """
15
15
  Check the manifest file to determine if there's a recording in progress.
16
- :returns: True if there's a "current_entry" in the manifest, else False
16
+
17
+ :return: True if there's a "current_entry" in the manifest, else False
17
18
  """
18
19
  manifest = self.get_manifest()
19
20
  return manifest.current_entry is not None
@@ -24,8 +25,9 @@ class RayhunterApi:
24
25
  def _get_file_content(self, api_endpoint: str) -> bytes:
25
26
  """
26
27
  Stream a file from the given API endpoint into memory.
28
+
27
29
  :param api_endpoint: The endpoint from which to retrieve a file
28
- :returns: The contents of the file (bytes)
30
+ :return: The contents of the file (bytes)
29
31
  """
30
32
  file_content = io.BytesIO()
31
33
  file_url = urllib.parse.urljoin(self._url, api_endpoint)
@@ -40,7 +42,8 @@ class RayhunterApi:
40
42
  def get_manifest(self) -> QmdlManifest:
41
43
  """
42
44
  Fetch a copy of the QMDL manifest, used to track the names of previous and active recordings.
43
- :returns: An instance of `QmdlManifest` populated from the target device
45
+
46
+ :return: An instance of `QmdlManifest` populated from the target device
44
47
  """
45
48
  manifest_url = urllib.parse.urljoin(self._url, "/api/qmdl-manifest")
46
49
  logging.info(f"Fetching manifest from: {manifest_url}")
@@ -51,8 +54,9 @@ class RayhunterApi:
51
54
  def get_analysis_report_file(self, filename: str) -> bytes:
52
55
  """
53
56
  Fetch a copy of the analysis report for a given capture. Use `get_manifest` to identify capture names.
57
+
54
58
  :param filename: The capture file name
55
- :returns: The contents of the analysis report file (bytes)
59
+ :return: The contents of the analysis report file (bytes)
56
60
  """
57
61
  logging.info(f"Fetching analysis report for capture: {filename}")
58
62
  api_endpoint = f"/api/analysis-report/{filename}"
@@ -61,8 +65,9 @@ class RayhunterApi:
61
65
  def get_pcap_file(self, filename: str) -> bytes:
62
66
  """
63
67
  Fetch a copy of the pcap file for a given capture. PCAP is dynamically generated from QMDL by the Rayhunter binary when this API is called.
68
+
64
69
  :param filename: The capture file name (found in manifest)
65
- :returns: The contents of the pcap file (bytes)
70
+ :return: The contents of the pcap file (bytes)
66
71
  """
67
72
  logging.info(f"Fetching PCAP file for capture: {filename}")
68
73
  api_endpoint = f"/api/pcap/{filename}"
@@ -71,8 +76,9 @@ class RayhunterApi:
71
76
  def get_qmdl_file(self, filename: str) -> bytes:
72
77
  """
73
78
  Fetch a copy of the given QMDL file. Use `get_manifest` to identify QMDL capture names.
79
+
74
80
  :param filenae: The QMDL file name (found in manifest)
75
- :returns: The contents of the QMDL file (bytes)
81
+ :return: The contents of the QMDL file (bytes)
76
82
  """
77
83
  logging.info(f"Fetching QDML file for capture: {filename}")
78
84
  api_endpoint = f"/api/qmdl/{filename}"
@@ -99,7 +105,8 @@ class RayhunterApi:
99
105
  def system_stats(self):
100
106
  """
101
107
  Fetch disk and memory utilization stats from the API.
102
- :returns: An instance of `SystemStats` populated from the target device.
108
+
109
+ :return: An instance of `SystemStats` populated from the target device.
103
110
  """
104
111
  system_stats_url = urllib.parse.urljoin(self._url, "/api/system-stats")
105
112
  logging.info(f"Fetching system stats from: {system_stats_url}")
@@ -1,5 +1,3 @@
1
- import json
2
-
3
1
  from dataclasses import dataclass
4
2
  from typing import List, Optional
5
3
 
@@ -4,8 +4,9 @@ from dataclasses import dataclass
4
4
  def _size_str_to_int(size: str) -> int:
5
5
  """
6
6
  Convert string notation of megabytes (e.g. 214.7M) to an integer value representing bytes (e.g. 225129267).
7
+
7
8
  :param size: String notation, megabytes (e.g. 214.7M)
8
- :returns: An integer value representing bytes (e.g. 225129267)
9
+ :return: An integer value representing bytes (e.g. 225129267)
9
10
  """
10
11
  if size[-1] != "M":
11
12
  raise ValueError(f"Unsupported size suffix: {size[-1]} ({size})")