Skip to main content

An ETL and DataOps framework for building a lakehouse

Project description

Laktory

pypi test downloads versions license

An open-source DataOps and dataframe-centric ETL framework for building lakehouses.

laktory logo

Laktory is your all-in-one solution for defining both data transformations and Databricks resources. Imagine if Terraform, Declarative Automation Bundles, and dbt combined forces and added support for DataFrame API—that’s essentially Laktory.

This open-source framework streamlines the creation, deployment, and execution of data pipelines while adhering to essential DevOps practices such as version control, code reviews, and CI/CD integration. Powered by Narwhals, Laktory enables seamless transitions between Apache Spark, Polars, and other frameworks to perform data transformations reliably and at scale. Its modular and flexible design allows you to effortlessly combine SQL statements with DataFrame operations, reducing complexity and enhancing productivity.

what is laktory

Since Laktory pipelines are built on top of Narwhals, they can run in any environment that supports Python—from your local machine to a Kubernetes cluster. Pipelines can be orchestrated using tools like Apache Airflow or deployed directly as Databricks Jobs or Declarative Pipelines, offering both flexible and fully managed execution options.

But Laktory goes beyond data pipelines. It integrates seamlessly with Databricks Declarative Automation Bundles (DAB) by letting you deploy Laktory pipelines alongside your existing resources from your standard databricks bundle deploy .

Beyond DAB, Laktory empowers you to define and deploy your entire Databricks data platform—from Unity Catalog and access grants to compute and quality monitoring—providing a complete, modern solution for data platform management. This empowers your data team to take full ownership of the solution, eliminating the need to juggle multiple technologies. Say goodbye to relying on external Terraform experts to handle compute, workspace configuration, and Unity Catalog, while your data engineers and analysts try to combine DAB and dbt to build data pipelines. Laktory consolidates these functions, simplifying the entire process and reducing the overall cost.

dataops

Laktory pipelines can run locally for development, or be orchestrated at scale using tools like Apache Airflow or Databricks Workflows.

Help

See documentation for more details.

Installation

Install using

pip install laktory

For more installation options, see the Install section in the documentation.

A Basic Example

from laktory import models


node_brz = models.PipelineNode(
    name="brz_stock_prices",
    source={
        "format": "PARQUET",
        "path": "./data/brz_stock_prices/"
    },
    transformer={
        "nodes": []
    }
)

node_slv = models.PipelineNode(
    name="slv_stock_prices",
    source={
        "node_name": "brz_stock_prices"
    },
    sinks=[{
        "path": "./data/slv_stock_prices",
        "mode": "OVERWRITE",
        "format": "PARQUET",
    }],
    transformer={
        "nodes": [
            
            # SQL Transformation
            {
                "expr": """
                    SELECT
                      data.created_at AS created_at,
                      data.symbol AS symbol,
                      data.open AS open,
                      data.close AS close,
                      data.high AS high,
                      data.low AS low,
                      data.volume AS volume
                    FROM
                      {df}
                """   
            },
            
            # Spark Transformation
            {
                "func_name": "drop_duplicates",
                "func_kwargs": {
                    "subset": ["created_at", "symbol"]
                }
            },
        ]
    }
)

pipeline = models.Pipeline(
    name="stock_prices",
    nodes=[node_brz, node_slv],
)

pipeline.execute(spark=spark)

To get started with a more useful example, jump into the Quickstart.

Get Involved

Laktory is growing rapidly, and we'd love for you to be part of our journey! Here's how you can get involved:

  • Join the Community: Connect with fellow Laktory users and contributors on our Slack. Share ideas, ask questions, and collaborate!
  • Suggest Features or Report Issues: Have an idea for a new feature or encountering an issue? Let us know on GitHub Issues. Your feedback helps shape the future of Laktory!
  • Contribute to Laktory: Check out our contributing guide to learn how you can tackle issues and add value to the project.

A Lakehouse DataOps Template

A comprehensive template on how to deploy a lakehouse as code using Laktory is maintained here: https://github.com/okube-ai/lakehouse-as-code

In this template, 4 pulumi projects are used to:

  • {cloud_provider}_infra: Deploy the required resources on your cloud provider
  • unity-catalog: Setup users, groups, catalogs, schemas and manage grants
  • workspace: Setup secrets, clusters and warehouses and common files/notebooks
  • workflows: The data workflows to build your lakehouse

Okube Company

okube logo

Okube is dedicated to building open source frameworks, known as the kubes, empowering businesses to build, deploy and operate highly scalable data platforms and AI models.

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

laktory-0.10.0.tar.gz (693.4 kB view details)

Uploaded Source

Built Distribution

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

laktory-0.10.0-py3-none-any.whl (824.4 kB view details)

Uploaded Python 3

File details

Details for the file laktory-0.10.0.tar.gz.

File metadata

  • Download URL: laktory-0.10.0.tar.gz
  • Upload date:
  • Size: 693.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.14

File hashes

Hashes for laktory-0.10.0.tar.gz
Algorithm Hash digest
SHA256 150e3e167894523da1c869b7cae9b3576132c2edb60b16ead4f558fd91b4d2e3
MD5 14c928ab32177cf69d946d16e8a55994
BLAKE2b-256 0eff4c2ffb659e23a26e2af6f0728359213f700a4aae3cefb42f6eee8d085418

See more details on using hashes here.

File details

Details for the file laktory-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: laktory-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 824.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.14

File hashes

Hashes for laktory-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5423e152e734745ec88f0bc3a968ab37e656f548098f9e2658f162fd7bfca8b2
MD5 d87262bb8fb76f2f42cef40aa2be5dba
BLAKE2b-256 e87dfb341b384bc26fb9ad12cf31996386f34e8a09f51ad42e10981920c2a2d3

See more details on using hashes here.

Supported by

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