Turn any REST API into a standalone Lakeflow Declarative Pipeline, just generated code.
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.
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:
- Pick a Databricks CLI profile, then a catalog and schema (or type a schema name).
- Bootstrap writes a complete Databricks Asset Bundle project: the connector as an installable package under
src/, the pipeline underpipelines/, and adatabricks.ymlthat builds the wheel and attaches it to a serverless pipeline. - Deploy and Run drive
databricks bundle deployanddatabricks bundle runwithout 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 builder
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:
- Step by step example: medium blogpost (written for the 0.x YAML runtime, see the migration guide for what changed)
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| polymo-1.8.0.tar.gz | 218.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| polymo-1.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 449.0 kB
Release files / polymo-1.8.0.tar.gz
| Download URL | polymo-1.8.0.tar.gz |
|---|---|
| Size | 218.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85a1ae804d477b7f6bd9f5955cd415fd9309655e3a9b0a07b7bdb7c1bd5ff1e3
|
|
BLAKE2b-256 checksum How to use checksums |
412c3bfcb827c0e6b4d553c80652fa2689aa749acd2f16deeeacc8e75d14f23f
|
| 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 logRelease files / polymo-1.8.0-py3-none-any.whl
| Download URL | polymo-1.8.0-py3-none-any.whl |
|---|---|
| Size | 230.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2b53e3cac08b8de011d318f776b7c15127adc96e7f07585629b2dcfdb908744
|
|
BLAKE2b-256 checksum How to use checksums |
eca04746d94b7ffee50475ea19c756c03e92c1b9b195c2b717e0d306d5217912
|
| 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