Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

flow.record

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.

Records can be read and transformed to other formats by using output adapters, such as CSV and JSON.

For more information on how Dissect uses this library, please see the documentation.

Requirements

This project is part of the Dissect framework and requires Python.

Information on the supported Python versions can be found in the Getting Started section of the documentation.

Installation

flow.record is available on PyPI.

pip install flow.record

Usage

This library contains the tool rdump. With rdump you can read, write, interact, and manipulate records from stdin or from record files saved on disk. Please refer to rdump -h or to the rdump documentation for all parameters.

Records are the primary output type when using the various functions of target-query. The following command shows how to pipe record output from target-query to rdump:

user@dissect~$ target-query -f runkeys targets/EXAMPLE.vmx | rdump
<windows/registry/run hostname='EXAMPLE' domain='EXAMPLE.local' ts=2022-12-09 12:06:20.037806+00:00 name='OneDriveSetup' path='C:/Windows/SysWOW64/OneDriveSetup.exe /thfirstsetup' key='HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run' hive_filepath='C:\\Windows/ServiceProfiles/LocalService/ntuser.dat' username='LocalService' user_sid='S-1-5-19' user_home='%systemroot%\\ServiceProfiles\\LocalService'>
<...>

Programming example

Define a RecordDescriptor (schema) and then create a few records and write them to disk

from flow.record import RecordDescriptor, RecordWriter

# define our descriptor
MyRecord = RecordDescriptor("my/record", [
    ("net.ipaddress", "ip"),
    ("string", "description"),
])

# define some records
records = [
    MyRecord("1.1.1.1", "cloudflare dns"),
    MyRecord("8.8.8.8", "google dns"),
]

# write the records to disk
with RecordWriter("output.records.gz") as writer:
    for record in records:
        writer.write(record)

The records can then be read from disk using the rdump tool or by instantiating a RecordReader when using the library.

$ rdump output.records.gz
<my/record ip=net.ipaddress('1.1.1.1') description='cloudflare dns'>
<my/record ip=net.ipaddress('8.8.8.8') description='google dns'>

Declarative record definitions

Instead of with a RecordDescriptor, records can also be defined by subclassing RecordBase and annotating the fields, like a dataclass:

from datetime import datetime
from typing import Annotated

from flow.record.declarative import RecordBase, field


class HttpRequestRecord(RecordBase, name="http/request"):
    ts: datetime
    url: str  # Python types map to a field type, e.g. str to string
    status: Annotated[int, "uint32"]  # or field(typename="uint32")
    remote: str


record = HttpRequestRecord(ts=datetime.now(), url="http://flow.record", status=200, remote="127.0.0.1")

Every field can be None, so X | None is technically the more correct type hint. A field annotated with X | None has the same field type as X.

A subclass starts with the fields of its parent:

class HttpResponseRecord(HttpRequestRecord, name="http/response"):
    body: bytes

A field can have a default (status: int = 200), or be set in a __post_init__ method with field(init=False). The __post_init__ method receives the InitVar arguments of the constructor:

from dataclasses import InitVar


class HostRecord(RecordBase, name="example/host"):
    hostname: str = field(init=False)
    target: InitVar[Target]

    def __post_init__(self, target: Target) -> None:
        self.hostname = target.hostname

The declarative class is currently mostly a nicety for type checking. Internally, it defines a regular RecordDescriptor, and packing a record only stores that descriptor and the field values. So declarative records don't round-trip: unpacking one returns a record of the record class of the descriptor, not an instance of the declarative class.

Selectors

We can also use selectors for filtering and selecting records using a query (Python like syntax), e.g.:

$ rdump output.records.gz -s '"google" in r.description'
<my/record ip=net.ipaddress('8.8.8.8') description='google dns'>

$ rdump output.records.gz -s 'r.ip in net.ipnetwork("1.1.0.0/16")'
<my/record ip=net.ipaddress('1.1.1.1') description='cloudflare dns'>

Build and test instructions

This project uses tox to build source and wheel distributions. Run the following command from the root folder to build these:

tox -e build

The build artifacts can be found in the dist/ directory.

tox is also used to run linting and unit tests in a self-contained environment. To run both linting and unit tests using the default installed Python version, run:

tox

For a more elaborate explanation on how to build and test the project, please see the documentation.

Contributing

The Dissect project encourages any contribution to the codebase. To make your contribution fit into the project, please refer to the development guide.

Dissect is released as open source by Fox-IT (https://www.fox-it.com) part of NCC Group Plc (https://www.nccgroup.com).

Developed by the Dissect Team (dissect@fox-it.com) and made available at https://github.com/fox-it/dissect.

License terms: AGPL3 (https://www.gnu.org/licenses/agpl-3.0.html). For more information, see the LICENSE file.

Metadata

Release files for flow.record 3.22.dev25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flow.record 3.22.dev25
File Size Uploaded Provenance Actions
flow_record-3.22.dev25.tar.gz 150.1 kB With provenance Details for flow_record-3.22.dev25.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flow.record 3.22.dev25
File Interpreter ABI Platform Actions
flow_record-3.22.dev25-py3-none-any.whl Python 3 none any Details for flow_record-3.22.dev25-py3-none-any.whl

Total release size: 248.8 kB

Release files / flow_record-3.22.dev25.tar.gz

Download URL flow_record-3.22.dev25.tar.gz
Size 150.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3a2e9da7e2a6cb02855dedc6e8d21e57e9c082518487d7f434e48336df4cba0d
BLAKE2b-256 checksum
How to use checksums
cdad6a9f943138704c9a678861b2726ce58c75841b7c84aa394b18b9affb542a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / flow_record-3.22.dev25-py3-none-any.whl

Download URL flow_record-3.22.dev25-py3-none-any.whl
Size 98.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab0d3e26fc500d07d922d5ac82f19cb934ab78de86cae9156f0fa5119b276db8
BLAKE2b-256 checksum
How to use checksums
b268e4a87b71bb93d0c8c4ef1a7eae3907b99e23554208ba052b16bec1efd823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for flow.record 3.22.dev25

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flow_record-3.22.dev25.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page