Skip to main content

polnor-sqlalchemy

SQLAlchemy dialect for Polnor — connect every SQLAlchemy-aware tool (pandas, FastAPI, Alembic, Superset, Metabase, ORM apps) to a Polnor SQL warehouse over a single URL.

Install

pip install polnor-sqlalchemy

This installs polnor (the core SDK) and sqlalchemy>=2.0 as dependencies.

Quick start

from sqlalchemy import create_engine, text

engine = create_engine(
    "polnor://api.polnor.net/?token=<your-pat>&warehouse_id=<wh-id>"
)

with engine.connect() as conn:
    result = conn.execute(text("SELECT region, COUNT(*) c FROM demo.orders GROUP BY region"))
    for row in result:
        print(row)

URL format

polnor://<host>[:<port>]/?token=<...>&warehouse_id=<...>[&workspace_slug=<...>]
  • host — hostname of the Polnor API, e.g. api.polnor.net
  • token — personal access token (also accepted as the URL password)
  • warehouse_id — id of the SQL warehouse to run queries against
  • workspace_slug (optional) — pin to a specific workspace when the token spans multiple

Inside a Polnor notebook or job, you can use the bare form polnor:// — the SDK auto-resolves credentials from env vars injected by the runtime.

Pandas

import pandas as pd
df = pd.read_sql("SELECT * FROM demo.orders LIMIT 100", engine)

No more "Other DBAPI2 objects are not tested" warning — the dialect is the supported integration point for pandas.

Reflection

from sqlalchemy import MetaData, Table

md = MetaData()
orders = Table("orders", md, autoload_with=engine, schema="demo")
print([c.name for c in orders.columns])

Reflection uses Polnor's catalog API (polnor.tables) to introspect namespaces, table columns, and types. Iceberg has no FK/PK/index metadata — these are returned empty.

DDL — CREATE TABLE ... USING iceberg

from sqlalchemy import Column, Integer, String, Table, MetaData

md = MetaData()
users = Table(
    "users", md,
    Column("id", Integer, nullable=False),
    Column("email", String),
    schema="demo",
)
md.create_all(engine)   # emits: CREATE TABLE demo.users (...) USING iceberg

The dialect appends USING iceberg so Polnor routes the DDL to the Spark sidecar that can actually write Iceberg.

Compatibility

  • Python ≥ 3.9
  • SQLAlchemy ≥ 2.0
  • Polnor SDK ≥ 1.0

Limitations (V1)

  • Auto-commit only — no transactional rollback (Polnor warehouses run one statement per transaction at the engine level).
  • No native FK/PK/index reflection (Iceberg doesn't have these).
  • Async (asyncio + create_async_engine) not supported yet.

License

Apache-2.0.

Metadata

Release files for polnor-sqlalchemy 0.1.0

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

Source distribution (sdist)

Source distribution for polnor-sqlalchemy 0.1.0
File Size Uploaded Provenance Actions
polnor_sqlalchemy-0.1.0.tar.gz 9.9 kB Without provenance Details for polnor_sqlalchemy-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polnor-sqlalchemy 0.1.0
File Interpreter ABI Platform Actions
polnor_sqlalchemy-0.1.0-py3-none-any.whl Python 3 none any Details for polnor_sqlalchemy-0.1.0-py3-none-any.whl

Total release size: 19.2 kB

Release files / polnor_sqlalchemy-0.1.0.tar.gz

Download URL polnor_sqlalchemy-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
da9893b490ce38b6024d114e67523f01aa15a98e8bfbbc36be1546edd928fcfb
BLAKE2b-256 checksum
How to use checksums
1e77cf923894fb0539a633e16a8cc6af6f1ec7408582e4f248fdfdc6bad0e51d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / polnor_sqlalchemy-0.1.0-py3-none-any.whl

Download URL polnor_sqlalchemy-0.1.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6addfef876c2efb12bb632728616c8d613dee5d5be27ce2c5635489f21cb5df7
BLAKE2b-256 checksum
How to use checksums
603fd37141e319fd7661979238dbaeb10dc325e87fb129a71867915b569b4b48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for polnor-sqlalchemy 0.1.0

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.1.0 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