Skip to main content

semql-introspect

Bootstrap a semql Catalog from a live database.

Reads Information Schema, emits Python Cube stubs with heuristic measure / dimension / time-dimension inference and foreign-key derived joins. Designed for greenfield adoption — a team with 200 tables can generate the mechanical 80% of a catalog in seconds, then hand-edit the heuristic guesses.

Use this for cold-start scaffolding. For ongoing drift detection on a catalog you already have, see semql-validate-db — it probes a live database against an authored catalog and surfaces missing tables / columns / join predicates that the compiler can't see at build time.

Install

pip install semql-introspect

Usage

import duckdb
from semql.model import Dialect
from semql_introspect import introspect_to_python

con = duckdb.connect("warehouse.db")
print(introspect_to_python(con, dialect=Dialect.DUCKDB, schema="main"))

Or via CLI:

semql-introspect --backend duckdb --schema main --conn "warehouse.db"

Heuristics

  • Numeric columns named amount / price / revenue / cost / total / value / qty / quantity / count → Measure(agg="sum").
  • Columns ending in _id → Measure(agg="count_distinct") (the table's cardinality is usually interesting).
  • date / timestamp columns → TimeDimension.
  • Foreign keys → Join(relationship="many_to_one") plus the foreign-side Dimension(foreign_key=...).
  • Everything else → Dimension typed by the column's SQL type.

Heuristic guesses get a # TODO: review comment so the diff makes the inference choices reviewable.

Metadata

Release files for semql-introspect 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for semql-introspect 0.8.0
File Size Uploaded Provenance
semql_introspect-0.8.0.tar.gz 12.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for semql-introspect 0.8.0
File Interpreter ABI Platform
semql_introspect-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.4 kB

Release files / semql_introspect-0.8.0.tar.gz

Download URL semql_introspect-0.8.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f86e6ad9233e4a3f5e9cf2f0c00600dc6208b22c73450aedf58997efeeee1dea
BLAKE2b-256 checksum
How to use checksums
48b996e74cb4dddbf0a817ad4b9e7b6b0163290af86c6c4aec50c745af186676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / semql_introspect-0.8.0-py3-none-any.whl

Download URL semql_introspect-0.8.0-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e98a50e345c7d1a1b2fdb5fee819ee9328db9f955478aaf5e6d12459a486816c
BLAKE2b-256 checksum
How to use checksums
5670a376e57495d5ac056b500db5381d54e41bfcde413b70614bbdcfdebaee56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Security for semql-introspect 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for semql_introspect-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page