DataJunction
Introduction
DataJunction (DJ) is an open source metrics platform that allows users to define metrics and the data models behind them using SQL, serving as a semantic layer on top of a physical data warehouse. By leveraging this metadata, DJ can enable efficient retrieval of metrics data across different dimensions and filters.
Getting Started
To launch the DataJunction UI with a minimal DataJunction backend, start the default docker compose environment.
docker compose up
If you'd like to launch the full suite of services, including open-source implementations of the DataJunction query service and
DataJunction reflection service specifications, use the demo profile.
docker compose --profile demo up
DJUI: http://localhost:3000/ DJ Swagger Docs: http://localhost:8000/docs DJQS Swagger Docs: http://localhost:8001/docs Jaeger UI: http://localhost:16686/search Jupyter Lab: http://localhost:8888
How does this work?
At its core, DJ stores metrics and their upstream abstractions as interconnected nodes. These nodes can represent a variety of elements, such as tables in a data warehouse (source nodes), SQL transformation logic (transform nodes), dimensions logic, metrics logic, and even selections of metrics, dimensions, and filters (cube nodes).
By parsing each node's SQL into an AST and through dimensional links between columns, DJ can infer a graph of dependencies between nodes, which allows it to find the appropriate join paths between nodes to generate queries for metrics.
Semantic views and Explore
The semantic layer API exposes cubes as views and adds an Explore view at every discovery level.
POST /semantic/views requires a path array and returns the hierarchy and
views at the selected location. Use [] to browse the root. Missing or null
paths are rejected. For example:
{"path": ["sales", "main"]}
Deprecated POST /semantic/views/list returns a flat array of all matching cube
views and does not accept path. It preserves the legacy runtime_configuration
namespace and branch selectors.
The browsing response includes a view named @explore:sales:main with display name
Explore ( sales / main ). Namespace-only views use @explore:sales; the global
view uses @explore and display name Explore. The uid equals the scoped name.
These reserved names cannot collide with a cube's fully qualified DJ node name.
Hierarchy components use UTF-8 URL escaping with ~HH in place of %HH, keeping
each name in one URL path segment even after URL decoding. For example,
feature/foo becomes feature~2Ffoo. Literal ~, %, and : become ~7E,
~25, and ~3A, so escaped and literal branch names stay distinct.
Use /semantic/views/{name} with the exact name returned by discovery for
view details and append /compatible-metrics,
/compatible-dimensions, /sql, /query, /row-count, or /values for the
usual semantic operations. No scope needs to be forwarded separately, so generic
Semantic Layer clients, including the Superset extension, can use these views
without modifications. For example, the compatibility body can be:
{
"additional_configuration": {},
"selected_metrics": ["sales.main.revenue"],
"selected_dimensions": []
}
The scope is decoded and authorized on every request. Invalid names return 404;
conflicting namespace or branch options in additional_configuration return 400.
The name is an identity, not an authorization grant.
With neither discovery selector, Explore includes readable active non-Git
namespaces and only the literal main branch of Git repositories. A plain
namespace includes only its direct elements. A Git root's Explore view also
defaults to main, including matching nested namespaces and explicitly linked
branch namespaces outside the root's name prefix. This does not follow a
repository's configured default branch: a repository without main contributes
no Git elements to broader Explore views. Select a branch explicitly to explore
another branch, such as @explore:sales:feature~2Frevenue. Branch selectors and
cube discovery still expose other branches. Independent nested repositories are
excluded from a Git root's Explore view. Branch names use their actual Git
spelling, such as feature/revenue. A branch requires a Git root namespace.
Explore exposes valid, active metrics and dimension attributes the caller can read in the selected scope, including tagged local dimensions and role-qualified references. It does not require a cube. Empty selections return every available element. Selected metrics restrict dimensions to their common reachable attributes; selected dimensions restrict metrics to those supporting all of them. Dimension-only selections also narrow the remaining dimensions to compatible metric domains or attributes of the same dimension node. Unknown, inaccessible, or out-of-scope selections are rejected.
Explore metric and dimension name values use their fully qualified DJ IDs,
including role suffixes, so columns with the same leaf name remain distinct.
Query result schemas and row keys use these same names, independent of physical
SQL aliases. Human-readable labels remain available in column metadata.
Explore queries use live source definitions rather than a cube's stored filters or materialization. Dimension-only queries use the existing single-node domain query behavior; select a metric to combine attributes across dimension nodes. Existing cube views retain their fixed element sets, filters, and compatibility.
AI Integration
DataJunction provides an MCP (Model Context Protocol) client that enables AI assistants like Claude to interact with your semantic layer.
The MCP client is part of the DataJunction Python client package.
For installation and setup, see the MCP documentation in the client package.
Documentation
For more detailed documentation, visit datajunction.io.
Metadata
Release files for datajunction-server 0.0.291
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datajunction_server-0.0.291.tar.gz | 11.5 kB | With provenance | Details for datajunction_server-0.0.291.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datajunction_server-0.0.291-py3-none-any.whl | Python 3 | none | any | Details for datajunction_server-0.0.291-py3-none-any.whl |
Total release size: 1.5 MB
Release files / datajunction_server-0.0.291.tar.gz
| Download URL | datajunction_server-0.0.291.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc51cd082c1b9bea2050dce067516dfbafb69e51006aa88d08aa05b9cc92f1ee
|
|
BLAKE2b-256 checksum How to use checksums |
7e87bfeeef308a42aa10197b6e909371265faf63e3cf7dfde2e0ad83ddccad42
|
| 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 Dec 4, 2026.
Transparency logRelease files / datajunction_server-0.0.291-py3-none-any.whl
| Download URL | datajunction_server-0.0.291-py3-none-any.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80dbf1e56eb9a9874d3c982252057192d25d160e2269f59a3ff5c834594fc0b9
|
|
BLAKE2b-256 checksum How to use checksums |
4a51decd1a8b8bfc0f6dcdfb7a8e0490d5e5039f12d45ba3504ce7ef414dbb97
|
| 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 Dec 4, 2026.
Transparency logSecurity for datajunction-server 0.0.291
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.
Attestation for datajunction_server-0.0.291.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 Dec 4, 2026.
Transparency logA 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.