Skip to main content

Semolina

[ Docs ]

The ORM for your Semantic Layer.

Typed models in Python, supporting IDE autocomplete, and a Django-like fluent query interface for the semantic layer of your data warehouse backend.

pip install semolina
pip install "semolina[snowflake]"
pip install "semolina[databricks]"

A model maps to a semantic view in your warehouse.

from semolina import (
    SemanticView,
    Metric,
    Dimension,
)


class Sales(SemanticView, view="sales"):
    revenue = Metric()
    cost = Metric()
    country = Dimension()
    region = Dimension()

Semolina needs an engine to talk to your warehouse. An engine owns one connection pool and the dialect for a backend. Build one with create_engine and register it before running any queries:

from semolina import create_engine, register

engine = create_engine(
    "default"
)  # reads [connections.default] from .semolina.toml
register("default", engine)

Use Model.query() to start building. Chain .metrics() and .dimensions() to select the fields you want, then call .execute():

query = (
    Sales.query()
    .metrics(Sales.revenue)
    .dimensions(Sales.country)
)

.execute() returns a SemolinaCursor. Use it as a context manager so the pooled connection is released when you are done, and call .fetchall_rows() to get Row objects that support both attribute and dict-style access:

with query.execute() as cursor:
    for row in cursor.fetchall_rows():
        print(row.country, row.revenue)  # attribute access
        print(row["country"])  # dict-style access

You should see output like:

CA 2000
CA
US 1500
US

Metadata

Release files for semolina 0.9.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 semolina 0.9.0
File Size Uploaded Provenance Actions
semolina-0.9.0.tar.gz 243.4 kB With provenance Details for semolina-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for semolina 0.9.0
File Interpreter ABI Platform Actions
semolina-0.9.0-py3-none-any.whl Python 3 none any Details for semolina-0.9.0-py3-none-any.whl

Total release size: 510.5 kB

Release files / semolina-0.9.0.tar.gz

Download URL semolina-0.9.0.tar.gz
Size 243.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a9d382a35ebe1ad4fed98a49481e6d0ef33fc73807959920b5566c8efbe08033
BLAKE2b-256 checksum
How to use checksums
98b4d06cb16c954ab40ad6a6c6b1834286a7483acac5a5dc7f9172d544360648
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Release files / semolina-0.9.0-py3-none-any.whl

Download URL semolina-0.9.0-py3-none-any.whl
Size 267.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb2417b01ee3f72a0f8848361b74c341ce3d23b38442d7a3c3152fe2783b6abd
BLAKE2b-256 checksum
How to use checksums
5212cc4f31e53c4cd945c1f2bda9e4ce096b8932c6ac07fd7bfe4954faa7fdeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Security for semolina 0.9.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for semolina-0.9.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 26, 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