Skip to main content

Polnor Python SDK — query Iceberg lakehouses, manage notebooks/jobs/models, MLflow-compatible tracking.

Project description

Polnor Python SDK

MLflow-compatible tracking for jobs running on the Polnor lakehouse.

Install

pip install polnor

Or, from a local checkout (contributors / pre-release):

pip install -e ./sdk/python

Configure

Set three environment variables before importing the SDK:

Variable Required Notes
POLNOR_API_URL yes e.g. https://api.polnor.net
POLNOR_TOKEN yes Personal access token from /settings/tokens
POLNOR_EXPERIMENT_ID optional Default experiment for start_run()
POLNOR_WORKSPACE_SLUG optional When the token isn't workspace-scoped

Inside a Polnor job these are injected automatically.

Quickstart

from polnor import mlflow

with mlflow.start_run(run_name="train-resnet50") as run:
    mlflow.log_params({"lr": 0.01, "batch_size": 32, "optimizer": "adam"})

    for epoch in range(10):
        loss, acc = train_one_epoch()
        mlflow.log_metrics({"loss": loss, "accuracy": acc}, step=epoch)

    mlflow.set_tag("git_commit", os.environ.get("CI_COMMIT_SHA", "dev"))

The run handle is also usable without the with block:

run = mlflow.start_run()
try:
    mlflow.log_metric("score", 0.93)
finally:
    mlflow.end_run("completed")

What's supported

API Status
start_run / end_run / active_run
log_metric / log_metrics (latest value wins)
log_param / log_params
set_tag / set_tags
autolog() context manager
Per-step metric history (time series) ⏳ planned
log_artifact (presigned-URL upload) ⏳ planned
Sklearn / PyTorch / TF auto-instrumentation ⏳ planned

How it differs from upstream MLflow

  • Server-side, metrics merge into a single JSONB blob — the latest value per key wins. The full (step, value, timestamp) history is in scope for a follow-up migration.
  • No server-side parameter immutability check yet — calling log_param("lr", 0.02) after log_param("lr", 0.01) overwrites silently. Upstream MLflow rejects with 400.
  • No mlflow.search_runs() — use the REST API (GET /api/v1/experiments/:id/runs) directly until we wrap it.

Development

pip install -e ".[test]"
pytest

Tests use responses to mock HTTP — no live API needed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polnor-0.2.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

polnor-0.2.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file polnor-0.2.0.tar.gz.

File metadata

  • Download URL: polnor-0.2.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for polnor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2e48315ef298fab505350eabfa48fd4fe4e631df7b815d7c71fcf8682dfaa2f6
MD5 9604c1a3c99baca052cc4c166a759fe0
BLAKE2b-256 e1a71ae26df1a40848a115944db2964ecd6c93644d1a9f01a997eaf0e427eded

See more details on using hashes here.

File details

Details for the file polnor-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: polnor-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for polnor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58361511b5830626f646da5910db4e8fb5869b02be94eb5f208bd2fa479d9188
MD5 57eeecedf603debf665ce07ff1c43551
BLAKE2b-256 6471431ea130dac7d019a61f1424bf729986543b8ba638702f5c0f5b32083b8f

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