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.4.0.tar.gz (26.0 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.4.0-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for polnor-0.4.0.tar.gz
Algorithm Hash digest
SHA256 d2debde63ae001ea563ad9f6c7c8b4c7dc30325bdf8525985334ea5276644c15
MD5 bd8e96ca745910037696b9ff397d3857
BLAKE2b-256 47725a616075fa39711098aa19639a5113c3a9e9dd86b9c31fe1f5d8383db3fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: polnor-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 29.5 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df55c1e2c7cff24dd6486f531ce926f88608adf4e09775e90701f0957335597d
MD5 9825decb09da86cb90ce1ae5d9e63e85
BLAKE2b-256 0143f940824df087e010fa79a4008d62a20c73ff89713477a3ed847d9e2a0d27

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