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.1.0.tar.gz (9.5 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.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for polnor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 31bb5e041c6b122422b70b621d847347b121bb9802d6ddf024ebfcbcd1078f20
MD5 6c8a71e31dad87b64bd90d3d83ffcbe9
BLAKE2b-256 9f616916a49210a5707059fdb56ade59783415a14aa7e142968a91476900a8a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: polnor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68d87c83f9ed8f8801d442e2dd44d4d4115ba2db8a5c720cba9d682bd4769937
MD5 f14abe0c28a5088ef44b76a9c0732584
BLAKE2b-256 ab7cd91edfe4cf4fc63b4fec235f1c1d1c9e2e113232b8c051310dbdb4a57111

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