Skip to content

crocs-muni/scrutiny-viz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scrutiny-viz

Compare two smart-card measurement profiles (JSON) using a YAML schema and generate:

  • a machine-readable comparison JSON, and
  • a self-contained HTML report.

The project is modular: comparators, schemas, and visualizations can be extended without rewriting the core.


What you get

  • verify.py: compares reference vs profile using a schema
  • report_html.py: turns the verification JSON into an HTML report
  • data/style.css + data/script.js: report styling/behavior
  • YAML schemas: define sections, comparators, and report visuals (report.types)

Requirements

  • Python: 3.9+ recommended
  • pip: installed with Python

Python dependencies (from requirements.txt):

  • dominate~=2.9.1
  • jsonpickle~=2.0.0
  • flake8~=3.9.0
  • overrides~=7.7.0
  • PyYAML~=6.0.2

Setup

1) Clone

git clone https://github.com/crocs-muni/scrutiny-viz.git
cd https://github.com/crocs-muni/scrutiny-viz.git

2) (Recommended) Create a virtual environment

Linux / macOS

python3 -m venv .venv
source .venv/bin/activate

Windows (PowerShell)

py -m venv .venv
.\.venv\Scripts\Activate.ps1

If PowerShell blocks activation:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

3) Install dependencies

pip install -r requirements.txt

Verify (generate comparison JSON)

Help

python verify.py -h

Generic example

python verify.py \
  -s path/to/schema.yml \
  -r path/to/reference.json \
  -p path/to/profile.json \
  -o results/comparison.json

CPLC example

python verify.py `
  -s .\scrutiny\javacard\modules\jcCPLC.yml `
  -r ".\data\examples\CSOB VISA debit.json" `
  -p ".\data\examples\CSOB VISA debit.json" `
  -o test.json `
  -v --print-diffs 100 --print-matches 100 -rep

Generate HTML report

Help

python report_html.py -h

Example

python report_html.py -v test.json -o comparison.html

The report is written to the results/ folder (depending on your script config), typically:

  • results/comparison.html

Report visuals (YAML)

Each section can specify what is rendered using report.types.

Example: table only

report:
  types: ["table"]

Example: table variant (CPLC)

report:
  types:
    - type: table
      variant: cplc

Example: chart + table + radar

report:
  types:
    - type: chart
    - type: table
    - type: radar

If your build uses “strict types from YAML”, only visuals listed in report.types will be shown.


Common issues

“comparator 'X' not found; falling back to 'basic'”

  • Make sure the comparator is registered/imported.
  • Ensure the schema uses the correct comparator name.

“No table/radar/chart is shown”

  • Confirm the section has report.types set in YAML.
  • Confirm your “strict YAML” behavior if enabled (no inference).

“Show All / Hide All / Default doesn’t work”

  • Ensure data/script.js is present and loaded.
  • Ensure toggle blocks are created via show_hide_div(...) so they get the right HTML attributes.

Development

Suggested repo structure (example)

scrutiny/
  reporting/
    viz/
  htmlutils.py
  ...
data/
  style.css
  *.json
  script.js
schemas/
  *.yml
verify.py
report_html.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •