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.1.tar.gz (30.9 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.1-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polnor-0.4.1.tar.gz
  • Upload date:
  • Size: 30.9 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.1.tar.gz
Algorithm Hash digest
SHA256 1d47bdd1a49987d4ceca477da85d1ac722be861be3284659eb2378138e6ed9c1
MD5 c8a16386a6720b0f1c2a7ded504c24f0
BLAKE2b-256 2fb31547f7bac10addeb4d186f72d5413e803c0222c5a47acd35cf540c61b1e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: polnor-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 36.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 579b001263613438290c01be2b34b25361b8db50211e7ea1476dd49acdc75f9d
MD5 33860dfe8c6630bb21877c0f1da0a9ff
BLAKE2b-256 fa282edbfacb62899717a4200f9a411b0c69326400bfdb9ef3b04340eace0c89

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