A boring semantic layer built with ibis
Project description
Boring Semantic Layer (BSL)
The Boring Semantic Layer (BSL) is a lightweight semantic layer based on Ibis.
Key Features:
- Lightweight:
pip install boring-semantic-layer - Ibis-powered: Built on top of Ibis, supporting any database engine that Ibis integrates with (DuckDB, Snowflake, BigQuery, PostgreSQL, and more)
- MCP-friendly: Perfect for connecting LLMs to structured data sources
Quick Start
pip install 'boring-semantic-layer[examples]'
1. Define your ibis input table
import ibis
# Create a simple in-memory table
flights_tbl = ibis.memtable({
"origin": ["JFK", "LAX", "JFK", "ORD", "LAX"],
"carrier": ["AA", "UA", "AA", "UA", "AA"]
})
2. Define a semantic table
from boring_semantic_layer import to_semantic_table
flights = (
to_semantic_table(flights_tbl, name="flights")
.with_dimensions(origin=lambda t: t.origin)
.with_measures(flight_count=lambda t: t.count())
)
3. Query it
result_df = flights.group_by("origin").aggregate("flight_count").execute()
📚 Documentation
This project is a joint effort by xorq-labs and boringdata.
We welcome feedback and contributions!
Freely inspired by the awesome Malloy project. We loved the vision, just took the Python route.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boring_semantic_layer-0.3.11.tar.gz.
File metadata
- Download URL: boring_semantic_layer-0.3.11.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45ebf8330350fe3faaddc3c7bade1e5a66036d6b9dce0271e4121a32ef4c6f45
|
|
| MD5 |
a2181f5cd934fe85caa47d316f03aff1
|
|
| BLAKE2b-256 |
5e05595c37939c52c5561a7705035b9e87a26afeaea701b0b57ee802b39408f2
|
File details
Details for the file boring_semantic_layer-0.3.11-py3-none-any.whl.
File metadata
- Download URL: boring_semantic_layer-0.3.11-py3-none-any.whl
- Upload date:
- Size: 549.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbd42a17d889f3c5a267c8520c78b6d6d3f8e7a42a1bfd57462068d1d9c4ff08
|
|
| MD5 |
735cc80fd7eb7ccf5f39ca8301758edb
|
|
| BLAKE2b-256 |
64ab019a912dbbe75492a23ceaaeece6ed42cb60b42997e812417b56297b3761
|