Skip to main content

Nomox Semantic Model

The shared knowledge contract between every Nomox service. Describes what data exists (physical layer) and what it means (ontology), and ties the two together so an agent can move from a natural-language concept all the way down to a specific column in a specific table.

Installation

The repo is private, so all installs need a GitHub Personal Access Token (PAT) with repo scope. Export it as GITHUB_TOKEN before installing.

Ad-hoc install

pip install git+https://${GITHUB_TOKEN}@github.com/Nomox-ai/semantics-model.git

Pin to a tag for reproducible installs:

pip install git+https://${GITHUB_TOKEN}@github.com/Nomox-ai/semantics-model.git@v0.1.1

Adding to requirements.txt

Add the following line so the package is pulled automatically on pip install -r requirements.txt:

nomox-semantics @ git+https://${GITHUB_TOKEN}@github.com/Nomox-ai/semantics-model.git@main

@main tracks the latest commit on main. Replace it with a tag (e.g. @v0.1.1) or a commit SHA if you ever need to pin to a specific version.

Heads up: pip caches git installs by URL, so a plain pip install -r requirements.txt will say "Requirement already satisfied" and skip the fetch even when main has moved. To force the latest:

pip install --upgrade --force-reinstall --no-deps nomox-semantics
# or, to refresh everything in the file
pip install -r requirements.txt --upgrade --force-reinstall

Then before installing:

# bash / zsh
export GITHUB_TOKEN=github_pat_...
pip install -r requirements.txt

Never commit the raw PAT - keep it in an env var, a .env file that is gitignored, or your CI's secret store. If a token ever lands in source, revoke it immediately at github.com/settings/tokens.

pyproject.toml equivalent

[project]
dependencies = [
    "nomox-semantics @ git+https://${GITHUB_TOKEN}@github.com/Nomox-ai/semantics-model.git@main",
]

Importing

The distribution is named nomox-semantics, but the Python import name is nomox_semantics (underscore). Every public symbol is re-exported from the top-level package, so always import from nomox_semantics directly - not from submodules:

from nomox_semantics import (
    # Physical layer
    DataSource, SourceType, SyncStatus,
    Table, Column, ColumnDataType, ForeignKeyRef,
    # Semantic layer
    BusinessDomain, Entity, EntityAttribute, EntityTableMapping,
    AttributeRole, SemanticType, Relationship, RelationshipCardinality,
    # Metrics
    Metric, MetricType, MetricFormat, MetricFilter, MetricColumnRef,
    # Glossary
    GlossaryTerm,
    # Queries
    SavedQuery, QueryStatus, QueryTrace, QueryResult, Dashboard,
    # Root
    SemanticCatalog,
)

Quickstart

from uuid import uuid4
from nomox_semantics import (
    SemanticCatalog, DataSource, SourceType, Table, Column, ColumnDataType,
    Entity, EntityAttribute, EntityTableMapping, AttributeRole, SemanticType,
)

# 1. Physical layer — what exists in the database
src   = DataSource(slug="prod", name="Prod", source_type=SourceType.POSTGRES)
users = Table(source_id=src.id, schema_name="public", table_name="users")
ltv   = Column(table_id=users.id, source_id=src.id, column_name="ltv_cents",
               ordinal_position=1, data_type=ColumnDataType.BIGINT, raw_data_type="bigint")

# 2. Semantic layer — what the data means in business terms
customer = Entity(
    slug="customer", name="Customer", plural_name="Customers",
    aliases=["user", "account holder"],                      # for natural-language matching
    table_mappings=[EntityTableMapping(table_id=users.id, source_id=src.id)],  # entity -> table
)

# An EntityAttribute binds a business field to a physical column
ltv_attr = EntityAttribute(
    entity_id=customer.id, column_id=ltv.id, source_id=src.id,
    name="lifetime_value", display_name="Lifetime Value",
    role=AttributeRole.MEASURE, default_aggregation="SUM",   # tells the query engine it's aggregatable
    semantic_type=SemanticType.CURRENCY, unit="EUR",         # values are EUR, not raw cents
)

# 3. Assemble the catalog — the root object every Nomox service consumes
catalog = SemanticCatalog(organisation_id=uuid4(), name="Acme")
catalog.sources[src.id] = src
catalog.tables[users.id] = users
catalog.columns[ltv.id] = ltv
catalog.entities[customer.id] = customer
catalog.attributes[ltv_attr.id] = ltv_attr

Documentation

See docs/ for the full design documentation.

Metadata

Release files for nomox-semantics 0.3.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 nomox-semantics 0.3.0
File Size Uploaded Provenance Actions
nomox_semantics-0.3.0.tar.gz 56.3 kB With provenance Details for nomox_semantics-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nomox-semantics 0.3.0
File Interpreter ABI Platform Actions
nomox_semantics-0.3.0-py3-none-any.whl Python 3 none any Details for nomox_semantics-0.3.0-py3-none-any.whl

Total release size: 79.8 kB

Release files / nomox_semantics-0.3.0.tar.gz

Download URL nomox_semantics-0.3.0.tar.gz
Size 56.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5e6a6f3ca2e53c5c9b1ef8774e40a50543a7bb939c1ad99fa79800dcbac76c90
BLAKE2b-256 checksum
How to use checksums
5f243bf2457731e2826734a6b4d9d1df4e2aadb67010cc2289ed64c396cf9ddb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Aug 20, 2026.

Transparency log

Release files / nomox_semantics-0.3.0-py3-none-any.whl

Download URL nomox_semantics-0.3.0-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d0837fc345ba21e77434a818e85a35bb307f3ce70372b7d90ae499e3c50be08
BLAKE2b-256 checksum
How to use checksums
172ac0f33717f3894b847613e8c33e646105b79a0cf1441d2f544be57b8c1a55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Aug 20, 2026.

Transparency log

Security for nomox-semantics 0.3.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 nomox_semantics-0.3.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 Aug 20, 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