A tiny, self-contained dataset for trying pview: 10 people, 9 images,
and one person with no image so you can see the generated-card fallback.
| File | What it is |
|---|---|
people.csv |
10 rows — name, age, department, city, start_date, salary, photo. The last row (Júlia Costa) has an empty photo. |
images/ |
9 images of random things, at deliberately mixed sizes/aspect ratios (wide 960×360, tall 300×820, large 1024×1024, small 240×240, …). |
make_assets.py |
Regenerates images/ from scratch (no network, just Pillow). |
From this directory:
pview build people.csv \
--name-col name \
--image-col photo \
--card-fields name,department,city \
--facet department=category --facet city=category \
--title "pview demo — 10 people" \
--out ./siteExpected output:
Built 10 items (1 generated, 0 image errors, 1 atlases) -> ./site
Add --single-file (and e.g. --out ./people.html) to get one portable
HTML file with all assets inlined.
- Scaling / fitting — every source image, whatever its dimensions, is
scaled to fit a fixed square tile while keeping its aspect ratio, then centered.
Open
site/atlas/atlas_0.pngto see them side by side: the wide horizon is letterboxed (full width, background bands top-and-bottom), the tall tower is pillarboxed (full height, background bands left-and-right), the squares fit edge-to-edge. The uncovered margins use the same per-item background color as the generated cards, so nothing is cropped away. - Generated cards — the one row with a blank
photo(Júlia Costa) becomes a text card: her name plus thecard-fields(department,city) drawn on a deterministic, per-item background color. The same fallback kicks in for any missing or unreadable image, so a bad path never breaks a build. - Facet inference —
age/salaryinfer as numeric,start_dateas date, anddepartment/cityare pinned to category via--facet.
The build emits the interactive viewer alongside the data: open
site/index.htmlin a browser to filter, sort, search, and zoom the collection. The atlas PNG above is still handy for eyeballing how every tile was fit to its square at a glance.
python make_assets.py