Skip to main content

Record browser workflow sessions into krill recordings

Project description

krill-collector

A krill feeds by filtering everything that drifts past it — this package filters a live browser session, straining out the HTTP exchanges and user events that make up a workflow.

Record a browser workflow session, including server-side request capture, into a krill WorkflowRecording.

Install

Requires Python 3.10+ and uv. Playwright needs a browser binary the first time:

uv add krill-collector
uv run playwright install chromium

Usage

Record from the command line — drive the browser by hand, then close the tab to finish:

uv run krill-collect http://target-app.local -o logicflow.json

Or from Python:

from krill_collector import WorkflowCollector, save_recording

collector = WorkflowCollector("http://target-app.local")
recording = collector.collect()  # opens a browser; records until the tab closes
save_recording(recording, "logicflow.json")

The recording is consumed by the companion krill-fuzzer package.

API

browser session ──▶ intercept ──▶ record ──▶ WorkflowRecording ──▶ JSON
                     ├── network (RequestInterceptor)
                     ├── DOM events (EventRecorder)
                     └── server-side (ServerRequestRecorder)

krill_collector

Symbol Type Description
WorkflowCollector(target_url, server_project_roots) class Orchestrates a recording session: collect() (sync), async_collect()
ServerRequestRecorder(project_root, output_dir) class Standalone server-side PHP request capture: instrument(), deinstrument(), collect()
CollectorError Exception Browser launch failure or zero exchanges captured; subclass of KrillError
WorkflowRecording dataclass The recording output: exchanges, events, target, timings (from krill-core)
RecordedEvent / EventType recorded interaction + its kind (from krill-core)
save_recording function Write a recording to JSON (from krill-core)

krill-collect

Command-line recorder. krill-collect TARGET_URL [-o OUTPUT] [-s SERVER_ROOT ...] — records a browser session against TARGET_URL, writing JSON to OUTPUT (default logicflow.json). Repeat -s DIR to capture server-side requests from each project root.

Documentation

  • Docs index — collect module design and implementation notes.

Citation

If you use this project in academic work, please cite our paper. BibTeX (placeholder until the paper is released):

@misc{beluga_placeholder,
  title  = {{TODO: paper title — not yet released}},
  author = {{TODO: authors}},
  year   = {{TODO}},
  note   = {Paper not yet released. Citation entry will be updated on publication.}
}

License

GPL-2.0 — see 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

krill_collector-0.1.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

krill_collector-0.1.2-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file krill_collector-0.1.2.tar.gz.

File metadata

  • Download URL: krill_collector-0.1.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for krill_collector-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ff41b096345e4ac28704d54e4897345c3076393d85fdead68596fd226d636b74
MD5 8357dccbcfc9b356bb7e6d78021d4162
BLAKE2b-256 ebc9c739556fd104a2ca6fa4f237c2fd8a83ab612471d889b2aaf83cfcc2b289

See more details on using hashes here.

File details

Details for the file krill_collector-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for krill_collector-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4f4910da59a8e6c64d3267bc163c0d89c976aad119d5c10572abb381d86b20dc
MD5 73572130299baf4c822d42dac79b8840
BLAKE2b-256 88fbe3f522e6d27398f811922df54d4d347e9fdf74bf1c7728b7ee892189bb8e

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