Skip to main content

airlayer

An in-process semantic engine that compiles .view.yml definitions into dialect-specific SQL. Define your metrics once — dimensions, measures, filters, segments — and compile to Postgres, BigQuery, Snowflake, DuckDB, and 6 other dialects.

import airlayer

result = airlayer.compile(
    views_yaml=[open("orders.view.yml").read()],
    query_json='{"measures": ["orders.total_revenue"], "dimensions": ["orders.status"]}',
    dialect="postgres",
)
print(result["sql"])
print(result["columns"])

No database connection required. No server to deploy. The compiler runs in-process — pass in YAML definitions and a query, get back SQL, bind parameters, and column metadata.

Features

  • 10 SQL dialects: Postgres, BigQuery, Snowflake, DuckDB, MySQL, ClickHouse, Redshift, Databricks, SQLite, Domo
  • Automatic joins: Declare entities on views, and airlayer infers JOINs via BFS on the entity graph
  • 12 built-in motifs: contribution, rank, anomaly detection, YoY/MoM/WoW, trend, moving average, cumulative, and more
  • Custom motifs: Define reusable analytical patterns in .motif.yml files
  • Validation: Check .view.yml files for errors without compiling a query

API

airlayer.compile(views_yaml, query_json, dialect, ...)dict with sql, params, columns

airlayer.validate(views_yaml, ...)True or raises ValueError

See the full documentation for the query format, schema reference, and library usage guide.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airlayer-0.3.6.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

airlayer-0.3.6-cp313-cp313-win_amd64.whl (983.6 kB view details)

Uploaded CPython 3.13Windows x86-64

airlayer-0.3.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

airlayer-0.3.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

airlayer-0.3.6-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file airlayer-0.3.6.tar.gz.

File metadata

  • Download URL: airlayer-0.3.6.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for airlayer-0.3.6.tar.gz
Algorithm Hash digest
SHA256 3fae548a694076fbf8d6df04cdb95785a6b56b78088f7d68f183b816f618e881
MD5 681c687c423f28e9afeb55721bf87c7e
BLAKE2b-256 b434c0f58db1c284e22eef92b692186a572dc2cc2ac8140e456cf33386764c80

See more details on using hashes here.

File details

Details for the file airlayer-0.3.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: airlayer-0.3.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 983.6 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for airlayer-0.3.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6b337e4c990697126faf40e94884e0ce2456e295b6fe71878ad6bcc100016b88
MD5 5e47435eec8ff6b539aea2688fa94981
BLAKE2b-256 bf0a8e032a6bd5b92b7fba2e604a3d76c6359447544b9b5c959a81994f91dee5

See more details on using hashes here.

File details

Details for the file airlayer-0.3.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for airlayer-0.3.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be542344db5f14e9db7a86701d89fdebc744b796eabcd6f144e5ed85b5d4c1b3
MD5 e57cfc1ef61d605af69976158983899c
BLAKE2b-256 854bb0c14d2246b76eac24c51692311c4274e7f380f9d4784c32c586e7290367

See more details on using hashes here.

File details

Details for the file airlayer-0.3.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for airlayer-0.3.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 02cb840826565d095c1b3c0872fd118542573e67be6f2eee8b5471dbd53043fa
MD5 687197de95637d6d708a1056491da346
BLAKE2b-256 35b351583ecde9d410cb79e05300e5b8ad8f380922e0219ac05a21e4cac9f49c

See more details on using hashes here.

File details

Details for the file airlayer-0.3.6-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for airlayer-0.3.6-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 0401da34a569fac14d78e7e3a9ec70089180724e41368dcba5493b9b729a5882
MD5 201cac48ae57c0783e39100806bcc2dc
BLAKE2b-256 81c041d4f4152528e186f73a91e02e1e32a7c5c46d4233d9a1e1f0db04bbe725

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.6 This release

5 files

0.0.7

5 files

0.0.6

5 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page