Skip to main content

Laktory

pypi test downloads versions license

An open-source DataOps and dataframe-centric ETL framework for building lakehouses. Use it standalone or extend your existing DABs setup with it.

laktory logo

Laktory is an all-in-one solution for defining both data transformations and Databricks resources. Imagine if Declarative Automation Bundles (DAB) supported any Databricks resources and offered a declarative approach to data transformations, that's essentially Laktory.

Deploy it standalone as your full Databricks DataOps platform, or add it alongside your existing DAB setup to manage pipeline definitions and the resources DAB doesn't cover.

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 empowers you to define and deploy your entire Databricks data platform, from Unity Catalog and access grants to compute and quality monitoring. This empowers your data team to take full ownership of the solution, eliminating the need to juggle multiple technologies.

No more splitting ownership between Terraform for infrastructure and DAB for workflows. With Laktory, the team that builds the pipelines can own the stack end to end.

dataops

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",
    sources=[{
        "format": "PARQUET",
        "path": "./data/brz_stock_prices/"
    }],
    transformer={
        "nodes": []
    }
)

node_slv = models.PipelineNode(
    name="slv_stock_prices",
    sources=[{
        "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 stacks 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.

Metadata

Release files for laktory 0.13.1

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

Source distribution (sdist)

Source distribution for laktory 0.13.1
File Size Uploaded Provenance Actions
laktory-0.13.1.tar.gz 881.0 kB Without provenance Details for laktory-0.13.1.tar.gz

Built distribution (wheel)

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

Total release size: 2.0 MB

Release files / laktory-0.13.1.tar.gz

Download URL laktory-0.13.1.tar.gz
Size 881.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e26370b2e3e2e9af9c42a40df387ba2b6a38e71c74bbd24f1b7a249ab279d235
BLAKE2b-256 checksum
How to use checksums
7b6a74bd138ac1df4d71c5d3b4a90b48906092e9e97eaf0ea5ff20fd5d408c89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Release files / laktory-0.13.1-py3-none-any.whl

Download URL laktory-0.13.1-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
cd086be7731277c777415de86928bf777bc027b754977a9bddb80b83de0ba439
BLAKE2b-256 checksum
How to use checksums
f603e5947ac2a4a5b3cf41152e137a2e0a63d8fe3d2725b8b119536aabd1fc09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Security for laktory 0.13.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.13.1 This release

2 release files No provenance

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