Skip to main content

Search and query SCB registry metadata

Project description

regmeta

Search and query SCB registry metadata from a local SQLite database. Designed for programmatic use by LLM agents and tools; terminal use is secondary.

Install

uv tool install regmeta
regmeta maintain update      # downloads package + database (~400 MB compressed)

Alternatively, build from raw SCB CSV exports (requires access to mikrometadata.scb.se):

regmeta maintain build-db --csv-dir path/to/SCB-data/

Quick start

regmeta search --query "kommun"                     # search all fields
regmeta search --query "kommun" --field datacolumn  # column headers only
regmeta get register LISA                           # register overview
regmeta get schema --register LISA --years 2020     # columns for a year
regmeta get varinfo "Kön"                           # variable details
regmeta resolve --columns "Kon,FodelseAr"           # map column names
regmeta docs search "disponibel inkomst"            # search documentation

Use --help on any command or subcommand for full flag documentation.

Commands

Query

Command Purpose
search Free-text search across registers, variables, columns, and value codes
get register Register overview with variants
get schema Column listing per version, with --years, --columns-like, --summary, --flat
get varinfo Variable details with instance history
get values Value-set members for a CVID, with optional --valid-at date filter
get datacolumns All column aliases for a variable across registers
get coded-variables Variables with value sets, ranked by usage
get diff Schema changes between two years for a register
get lineage Variable provenance across registers
get availability Temporal coverage for a variable or register
resolve Exact alias lookup for column names (batch)

Documentation

Command Purpose
docs search Full-text search over curated register documentation
docs get Retrieve full documentation for a variable or topic
docs list Browse available documentation by type, topic, or register

Maintenance

Command Purpose
maintain update Update package and database to the latest version
maintain build-db Build database from SCB CSV exports
maintain build-docs Build documentation search index from markdown files
maintain info Database stats and import metadata

Output formats

All commands support --format {table,list,json}. Default is table, which auto-switches to list for narrow results. Add -v for the full JSON envelope (contract version, timing, database info).

Register arguments accept numeric IDs, exact names, or substring matches.

Database

Stored at ~/.local/share/regmeta/ by default. Override with --db or $REGMETA_DB.

Known limitations

  • Value sets are not version-specific. Historical union of all codes per CVID. Use --valid-at for temporal filtering.
  • Database size. ~1.6 GB on disk (~400 MB compressed).
  • LISA is composite. Variables are registered under source registers (RTB, RAMS, etc.), not under LISA itself. Use docs search for LISA-specific variable documentation.

Files

Path Purpose
DESIGN.md Design rationale and constraints
STRUCTURE.md Domain model (SCB metadata hierarchy)
docs/SCHEMA.md Documentation file format
src/regmeta/ Package source
tests/ Test suite

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

regmeta-0.5.1.tar.gz (372.7 kB view details)

Uploaded Source

Built Distribution

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

regmeta-0.5.1-py3-none-any.whl (576.3 kB view details)

Uploaded Python 3

File details

Details for the file regmeta-0.5.1.tar.gz.

File metadata

  • Download URL: regmeta-0.5.1.tar.gz
  • Upload date:
  • Size: 372.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for regmeta-0.5.1.tar.gz
Algorithm Hash digest
SHA256 02f8b5d9c95d72e4fa571af6c24f54091926c1b8fff2d82c66f46a46ecd350e2
MD5 ccf110ae37edf892a8d43de417606255
BLAKE2b-256 59fa7adac6111d3217f2f8a030a2a1c4ae9778c3e134b20f290f62feaa032106

See more details on using hashes here.

Provenance

The following attestation bundles were made for regmeta-0.5.1.tar.gz:

Publisher: publish_regmeta.yml on adamaltmejd/registry-research-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file regmeta-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: regmeta-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 576.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for regmeta-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 82835a9ed38ca82d3e6cc51a25f3dbe47e0556774c0c71c5aa7f6fbf2c4e6e7c
MD5 aa9592198074961cd64482edfc7ff820
BLAKE2b-256 c3d451f2f18cbd1747ffecdf4233dc0ff4f3dbf74ced90078938d7b04d2ac4f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for regmeta-0.5.1-py3-none-any.whl:

Publisher: publish_regmeta.yml on adamaltmejd/registry-research-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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