Skip to main content

Synopsis

dms stats --dir DIRECTORY

Description

dms stats scans every .json file in a directory and prints a set of summary tables to the terminal. It is useful for quickly understanding the composition of a collection and spotting records that are missing recommended metadata. Output sections:

Collection summary

Total records, valid count (has all five required fields), and invalid count.

Records by type

Count per heritage type with an inline bar chart.

Records by language

Count per language code, sorted by frequency.

Records by access level

Breakdown of rights.access_level values across the collection.

Top 15 subjects

Most frequent subject tags across all records.

Top 10 contributors

Creator names ranked by number of records they appear in.

Missing fields heatmap

For each recommended field (creator, date, subject, location, rights), shows how many records are missing it as a count, percentage, and inline bar.

Options

--dir
path
required
Directory of DMS records to analyse. Must exist and be a directory.

Example output

╔══════════════════════════════════╗
║ Collection Statistics            ║
║                                  ║
║   Total records:   24            ║
║   Valid:           22            ║
║   Invalid:         2             ║
╚══════════════════════════════════╝

 Records by Type
 ┌──────────────┬────────┬───────────────────────┐
 │ Type         │  Count │ Bar                   │
 ├──────────────┼────────┼───────────────────────┤
 │ story        │     10 │ ████████████████████  │
 │ poem         │      7 │ ██████████████        │
 │ photo        │      5 │ ██████████            │
 │ audio        │      2 │ ████                  │
 └──────────────┴────────┴───────────────────────┘

 Missing Recommended Fields:
      creator  4/24 (17%)  ░░░
         date  2/24  (8%)  ░
      subject  6/24 (25%)  ░░░░░
     location  9/24 (38%)  ░░░░░░░
       rights  3/24 (13%)  ░░

Examples

dms stats --dir records/

Notes

Validity in dms stats is determined by a quick check for the five required fields (id, title, type, description, language). For full schema validation including type constraints and enum values, use dms validate --dir.
Use the missing-field heatmap to prioritise enrichment work. Fields that are absent from a large percentage of records are the best candidates for a batch update.