Skip to main content

Simple Declarative Data Pipelines

Combine the simplicity of Trilogy with the tools of modern orchestration, such as DBT and Dagster.

Compile your models to ETL scripts to run on demand. Rebuild, run, and test easily.

Translates 'Persist' statements in Trilogy to scheduled ETL jobs.

Currently supported backends:

  • trilogy (optimize a Trilogy model, execute in memory)
  • dbt (optimize a Trilogy model, translate it to a DBT project, optionally execute with dbt CLI)
  • dagster (optimize a trilogy model, translate it to a dagster project, optionally execute with dagster CLI)

Flags

--optimize=X - Any CTE used at least X times in calculating final model outputs will be materialized for reuse.

Install

pip install pytrilogyt

How to Run

trilogyt <preql_path> <output_path> --run

Trilogy

Optimize and (optionally) execute a trilogy script (or set of scripts)

trilogyt trilogy trilogy/scripts trilogy/build bigquery --run

DBT

For dbt, the output_path should be the root of the dbt project, where the dbt_project.yml file exists.

An example command:

trilogyt dbt dbt/trilogy/ dbt bigquery --run

Each source .preql file will be built into a separate DBT sub folder with one model per persist statement. If optimization is enabled (default), there will be optional "optimization" tables that can be imported and depended on.

17:12:37  Running with dbt=1.7.4
17:12:38  Registered adapter: bigquery=1.7.2
17:12:38  Found 4 models, 4 tests, 0 sources, 0 exposures, 0 metrics, 447 macros, 0 groups, 0 semantic models
17:12:38
17:12:40  Concurrency: 4 threads (target='dev')
17:12:40
17:12:41  1 of 4 START sql view model dbt_test.customers ................................. [RUN]
17:12:41  2 of 4 START sql table model dbt_test.customers_preql_preqlt_gen_model ......... [RUN]
17:12:41  3 of 4 START sql table model dbt_test.my_first_dbt_model ....................... [RUN]
17:12:42  1 of 4 OK created sql view model dbt_test.customers ............................ [CREATE VIEW (0 processed) in 1.09s]
17:12:43  3 of 4 OK created sql table model dbt_test.my_first_dbt_model .................. [CREATE TABLE (2.0 rows, 0 processed) in 2.78s]
17:12:43  4 of 4 START sql view model dbt_test.my_second_dbt_model ....................... [RUN]
17:12:44  2 of 4 OK created sql table model dbt_test.customers_preql_preqlt_gen_model .... [CREATE TABLE (100.0 rows, 4.3 KiB processed) in 3.55s]
17:12:44  4 of 4 OK created sql view model dbt_test.my_second_dbt_model .................. [CREATE VIEW (0 processed) in 1.10s]
17:12:44
17:12:44  Finished running 2 view models, 2 table models in 0 hours 0 minutes and 6.37 seconds (6.37s).
17:12:45  
17:12:45  Completed successfully
17:12:45
17:12:45  Done. PASS=4 WARN=0 ERROR=0 SKIP=0 TOTAL=4
customers: success
my_first_dbt_model: success
customers_preql_preqlt_gen_model: success
my_second_dbt_model: success

Dagster

For Dagster, each source .preql file will be built as a model, with one entrypoint script that imports all resources. If optimization is enabled (default), there will be optional "optimization" tables that can be imported and depended on.

An example command:

trilogyt dagster dbt/models/core/ ./dbt bigquery --run

From IO

Write-Output native """constant x <-5; persist into static as static select x;""" | trilogyt <output_path> bigquery

Metadata

Release files for pytrilogyt 0.0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytrilogyt 0.0.22
File Size Uploaded Provenance Actions
pytrilogyt-0.0.22.tar.gz 25.5 kB With provenance Details for pytrilogyt-0.0.22.tar.gz

Built distribution (wheel)

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

Total release size: 58.4 kB

Release files / pytrilogyt-0.0.22.tar.gz

Download URL pytrilogyt-0.0.22.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
67ff0f3f600b85e11d14a74d69bd15788562620115e27b4f3f96bc5b8bc1782b
BLAKE2b-256 checksum
How to use checksums
afcef1ccc5c86595e2db5897c623dc76598eadaa3528a43d05cc25b2ba69a8b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 17, 2026.

Transparency log

Release files / pytrilogyt-0.0.22-py3-none-any.whl

Download URL pytrilogyt-0.0.22-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8c02ffae6661cdea5d3cc3bc7c42c2ad3a0a1bd3c1da9e0dd630a63de827cb4
BLAKE2b-256 checksum
How to use checksums
41ea09c8ee3077260c211c6b11554095d294549705c5d4f411e6c523c4e59870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 17, 2026.

Transparency log

Security for pytrilogyt 0.0.22

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pytrilogyt-0.0.22.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 Apr 17, 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