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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file krill_collector-0.1.3.tar.gz.
File metadata
- Download URL: krill_collector-0.1.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c6f8cbc38e872a57b39ec70e1e7c41044bd27dccb9155ceae01241474c108b9
|
|
| MD5 |
d2119a0847d84dcfe04f64d4b504c185
|
|
| BLAKE2b-256 |
535bc69b327246045a9f6eb7be3b0e6629d29562b31b7d459018c107d69ddd34
|
File details
Details for the file krill_collector-0.1.3-py3-none-any.whl.
File metadata
- Download URL: krill_collector-0.1.3-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5a58e6934991d7bbba48225c92eb2d421a98720ecc84aedb1b90c72eebaacd0
|
|
| MD5 |
ebfe1c1e4a45dea86bd68318b2ba61b9
|
|
| BLAKE2b-256 |
b87efac2d91ce15618df5707c2098b7f0e5b8a559bcc3900d97c84167b4258cf
|