Skip to main content

Search and query SCB registry metadata

Project description

reg_meta

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 reg-meta
reg-meta update      # downloads package + database (~400 MB compressed)

Alternatively, build from raw SCB CSV exports (maintainer flow — requires access to mikrometadata.scb.se and a repo checkout, since build-db reads classifications.toml, fqid_slugs/, and input_data/SCB/ from the working tree; none of those ship in the wheel):

git clone https://github.com/adamaltmejd/registry-research-toolkit
cd registry-research-toolkit
uv sync
uv run reg-meta-build build-db --input-dir reg_meta_build/input_data/

Quick start

reg-meta search --query "kommun"                     # search all fields
reg-meta search --query "kommun" --field datacolumn  # column headers only
reg-meta get register LISA                           # register overview
reg-meta get schema --register LISA --years 2020     # columns for a year
reg-meta get groups LISA                             # folded variable families
reg-meta get varinfo "Kön"                           # variable details
reg-meta resolve --columns "Kon,FodelseAr"           # map column names
reg-meta 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 register edition (validity window), with --years, --columns-like, --summary, --flat
get groups Concept groups (folded variable families) with member facets; --classifications for vintage families
get varinfo Variable details with per-era variable_state history
get values Value-set members for a variable, year-projected per variable_state era
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
get classification Normalized code systems (SUN, SSYK, SNI, LKF, ...) with --list, --codes, --variables
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
update Update package and database to the latest version
info Database stats and import metadata

Build commands (build-db, build-docs, seed-slugs, precheck-slugs, parse-sos) live in the separate reg_meta_build package. They are maintainer-only and require a repo checkout (the wheel does not ship classifications.toml, fqid_slugs/, or docs/); see the reg_meta_build README for the build flow.

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/reg_meta/ by default. Override with --db or $REG_META_DB.

Files

Path Purpose
DESIGN.md Design rationale, constraints, and the object model
../reg_meta_build/DESIGN.md Build pipeline and per-provider source-delivery shapes
../reg_meta_build/docs/SCHEMA.md Documentation markdown file format
src/reg_meta/ 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

reg_meta-0.12.1.tar.gz (188.3 kB view details)

Uploaded Source

Built Distribution

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

reg_meta-0.12.1-py3-none-any.whl (111.7 kB view details)

Uploaded Python 3

File details

Details for the file reg_meta-0.12.1.tar.gz.

File metadata

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

File hashes

Hashes for reg_meta-0.12.1.tar.gz
Algorithm Hash digest
SHA256 236094ab5f5a32f77a086a8c03be68b7a760bea0fcb0a82702b69f5686ad7074
MD5 3acd087396919345050d8e2245b1ce55
BLAKE2b-256 d8d4d08703cd894a43c33ace65f1ddfa8878f7656c3f60e941d14dd18d3d7474

See more details on using hashes here.

Provenance

The following attestation bundles were made for reg_meta-0.12.1.tar.gz:

Publisher: publish_reg_meta.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 reg_meta-0.12.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for reg_meta-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e0d7fc4a09a2af5cfd8aa9b1975801a7aec785c1c23a3c8fd0810b51ce1a6ff
MD5 9586a10b552da80b0cc26230a6bea516
BLAKE2b-256 1e36de62cfbb9bd547e78a3bcbe0b59db5dbd823f6b59c2f4a2e804693c8e51e

See more details on using hashes here.

Provenance

The following attestation bundles were made for reg_meta-0.12.1-py3-none-any.whl:

Publisher: publish_reg_meta.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