Skip to main content

Polymo

Turn any REST API into a standalone Lakeflow Declarative Pipeline, just generated code.

test docs PyPI - Python Version

Welcome to Polymo

Setting up API ingestion in Databricks Lakeflow Declarative Pipelines is tricky, because it involves classes and requires knowledge of inner working of declarative pipelines. Polymo is a tool that helps to define the pipeline from a UI. It allows you to preview the ingestion dataframes locally, and export a standalone Lakeflow Declarative Pipelines pipeline. polymo is never a dependency of the scripts it generates. The output is plain Python that only needs requests, the standard library, and pyspark. Nothing is imported from polymo, and there is no config file to load at runtime. The generated code is yours: edit it, version it, review it like any other code.

What Polymo generates

Pointing Polymo at https://jsonplaceholder.typicode.com/posts produces a single file. Shown here, the real script also contains the retry/backoff and response-normalization helpers.

"""Lakeflow Declarative Pipelines connector for posts."""

import time
from typing import Any, Iterator

import requests

BASE_URL: str = "https://jsonplaceholder.typicode.com"
PATH: str = "/posts"
PARAMS: dict[str, Any] = {"_limit": 20}
HEADERS: dict[str, str] = {}
TIMEOUT: float = 30.0


def fetch_records() -> Iterator[dict[str, Any]]:
    ...


from pyspark import pipelines as dp
from pyspark.sql import SparkSession
from pyspark.sql.datasource import DataSource, DataSourceReader


class RestSource(DataSource):
    ...


spark = SparkSession.getActiveSession()
spark.dataSource.register(RestSource)


@dp.table(name="posts")
def posts():
    return spark.read.format("posts_source").load()

Every field you fill in: pagination, incremental sync, partitioning, filter pushdown, error handling, headers, query parameters, an explicit schema, XML responses, streaming tables is baked in as a constant or a small block of specialized code. Options you don't use produce no code at all.

Polymo UI connector preview screen

How does it work?

Open Polymo, describe your API (base URL and path are the only required fields), and press Preview to see the DataFrame, the raw records, and the raw API responses side by side. When you're happy, switch to the Generated Code tab and download the script or bootstrap a Databricks project.

Ready to run it on Databricks? The Deploy tab walks through it: Select Profile → Target → Bootstrap → Deploy → Run:

  1. Pick a Databricks CLI profile, then a catalog and schema (or type a schema name).
  2. Bootstrap writes a complete Databricks Asset Bundle project: the connector as an installable package under src/, the pipeline under pipelines/, and a databricks.yml that builds the wheel and attaches it to a serverless pipeline.
  3. Deploy and Run drive databricks bundle deploy and databricks bundle run without leaving Polymo, with the CLI output docked below.

Secrets never land in generated code. Each auth field (bearer token, API key, OAuth2 client secret) and any {{ options.<name> }} placeholder can reference a Databricks secret scope or a Unity Catalog service credential backed by Azure Key Vault; the pipeline resolves the value on the driver and passes it to the reader, and Polymo redacts it from every preview. Requires the Databricks CLI and a ~/.databrickscfg profile, see Deploy to Databricks for the full walkthrough.

See the Connector options reference for what every field generates, and the Polymo UI walkthrough for a guided tour.

How to start?

pip install polymo

Launch the UI

polymo

Or without installing it first:

uvx polymo

(Optional) Run Polymo in Docker

docker compose up --build ui

The service listens on port 8000; open http://localhost:8000 once Uvicorn reports it is running.

Migrating from polymo 0.x?

The YAML runtime (spark.read.format("polymo"), PolymoConfig, polymo smoke) is gone since 1.0. See docs/migration-1.0.md for what changed, and pin polymo<1.0 (0.11.0 is the last release with the old runtime) if you're not ready to move yet.

Where to Next

Read the docs here.

Other material:

Contributing

Is there something missing? Raise an issue or contribute! Contributions and early feedback welcome.

pytest runs the unit suite against a local mock API and a local Spark session. POLYMO_LIVE=1 pytest tests/live additionally reads every connector option against public APIs (jsonplaceholder, PokeAPI, GitHub, GitLab, Wikipedia, httpbin, arXiv, ...) through Spark's Python Data Source API; the live workflow runs that weekly and on pull requests that touch code generation.


If Polymo helped, a ⭐ makes my day

Metadata

Release files for polymo 1.8.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 polymo 1.8.1
File Size Uploaded
polymo-1.8.1.tar.gz 216.8 kB Details

Built distribution (wheel)

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

Total release size: 447.3 kB

Release files / polymo-1.8.1.tar.gz

Download URL polymo-1.8.1.tar.gz
Size 216.8 kB
Tags Source
SHA-256 checksum
How to use checksums
70f02c6ee9795f85cf8f942367f08337a0ad55cda74a9c783ed68496846bcdcf
BLAKE2b-256 checksum
How to use checksums
356fa0fc127009234647b52ef6d5f0ffcf227b7727de70f6dc14277c020f22ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 5, 2026.

Transparency log

Release files / polymo-1.8.1-py3-none-any.whl

Download URL polymo-1.8.1-py3-none-any.whl
Size 230.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d60c89df2cd492d12fb5e3e345d042007bdc910a29a304873d1718b1e614d9e6
BLAKE2b-256 checksum
How to use checksums
c84a2e5e37fdbf8004f05733312aea86211f3433176741d7198857318e79e425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.8.1 This release

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.8.4

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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