Skip to main content

Unofficial Python bindings for EFF's Rayhunter API

Project description

python-rayhunter

Unofficial Python bindings for EFF's Rayhunter API.

Note: This project is not affiliated with the EFF or the Rayhunter project.

Documentation

Full documentation can be found on Read The Docs. Please read them, I worked hard on them.

Requirements

Installation

pip install python-rayhunter

Quick Start

from rayhunter import RayhunterApi

api = RayhunterApi(hostname="192.168.1.1", port=8080)

Usage

Check recording status

if api.active_recording:
    print("A recording is currently in progress")

Fetch the QMDL manifest

The manifest lists all capture files available on the device, plus the active capture (if any).

manifest = api.get_manifest()

for entry in manifest.entries:
    print(f"{entry.name} — started {entry.start_time}, size {entry.qmdl_size_bytes} bytes")

if manifest.current_entry:
    print(f"Active capture: {manifest.current_entry.name}")

Download capture files

Use the filenames from the manifest to download files.

# Raw QMDL capture data
qmdl_data = api.get_qmdl_file("capture.qmdl")

# PCAP file (dynamically generated from QMDL by the Rayhunter binary)
pcap_data = api.get_pcap_file("capture.qmdl")

# Analysis report
report_data = api.get_analysis_report_file("capture.qmdl")

Control recordings

# Start a new recording (stops any active recording first)
api.start_recording()

# Stop the current recording
api.stop_recording()

System statistics

stats = api.system_stats()

disk = stats.disk_stats
print(f"Partition:  {disk.partition} ({disk.mounted_on})")
print(f"Disk usage: {disk.used_size}/{disk.total_size} bytes ({disk.used_percent}% used)")

mem = stats.memory_stats
print(f"Memory:     {mem.used}/{mem.total} bytes used, {mem.free} bytes free")

API Reference

RayhunterApi(hostname, port)

The main client for interacting with the Rayhunter API.

Method Returns Description
active_recording bool True if a recording is currently in progress
get_manifest() QmdlManifest Fetch the QMDL manifest from the device
get_qmdl_file(filename) bytes Download a raw QMDL capture file
get_pcap_file(filename) bytes Download a PCAP file (generated on demand)
get_analysis_report_file(filename) bytes Download the analysis report for a capture
start_recording() Start a new recording
stop_recording() Stop the active recording
system_stats() SystemStats Fetch disk and memory utilisation stats

QmdlManifest

Attribute Type Description
entries List[QmdlManifestEntry] All finalised capture files on the device
current_entry Optional[QmdlManifestEntry] The active capture, or None

QmdlManifestEntry

Attribute Type Description
name str Capture file name
start_time str Timestamp when the capture started
last_message_time str Timestamp of the last captured message
qmdl_size_bytes int Size of the QMDL file in bytes
analysis_size_bytes int Size of the associated analysis file in bytes

SystemStats

Attribute Type Description
disk_stats DiskStats Disk usage information
memory_stats MemoryStats Memory usage information

DiskStats

Attribute Type Description
partition str Partition Rayhunter is mounted on (e.g. ubi0:usrfs)
total_size int Total disk size in bytes
used_size int Used disk space in bytes
available_size int Available disk space in bytes
used_percent int Percentage of disk space in use
mounted_on str Mount point (e.g. /data)

MemoryStats

Attribute Type Description
total int Total memory in bytes
used int Used memory in bytes
free int Free memory in bytes

License

Since "do what you'd like and don't blame me," isn't necessarily legally binding, this repository uses the MIT LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_rayhunter-2026.3.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_rayhunter-2026.3.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file python_rayhunter-2026.3.2.tar.gz.

File metadata

  • Download URL: python_rayhunter-2026.3.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for python_rayhunter-2026.3.2.tar.gz
Algorithm Hash digest
SHA256 12abf124d64547a6e81f661e3a32d0682c9c9d3a3e844f5e138236565eb6b9b4
MD5 ff192cb21826905122e1d68842bc6ae7
BLAKE2b-256 2e58545dda31000731a8d4638cab9ab660b5ffdc088f527f3a9834584f855b06

See more details on using hashes here.

File details

Details for the file python_rayhunter-2026.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_rayhunter-2026.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 de0865b1bd82c2e4a099c8ad81f09eceb268cbe5b33133464e055d4c13641eb9
MD5 51aa0f7c477af97cc903dec3a573730c
BLAKE2b-256 43e0cbf803c2a2fe793f3443f63787789f23861da07fff3bcac253d32bdf868a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page