Skip to main content

Namaka Python SDK for experiment tracking

Project description

Namaka Python SDK

Lightweight Python client for Namaka experiment tracking. Logs metrics in the background so it never blocks your training loop.

Installation

pip install namaka

Or for development:

cd sdk
pip install -e .

Quick Start

import namaka

run = namaka.init(
    project="my-project",
    api_url="http://localhost:8000/api/v1",
)

# Log hyperparameters
run["parameters"] = {
    "learning_rate": 0.001,
    "batch_size": 64,
    "model_type": "transformer",
}

# Log metrics during training
for epoch in range(100):
    loss = train_step()
    accuracy = evaluate()
    run.log("train/loss", loss, step=epoch)
    run.log("val/accuracy", accuracy, step=epoch)

run.stop()

Connecting to Render

run = namaka.init(
    project="my-project",
    api_url="https://namaka-backend.onrender.com/api/v1",
)

API Reference

namaka.init(project, api_url, name, api_token)

Creates a new run and returns a Run object. Creates the project if it doesn't exist.

Parameter Type Default Description
project str required Project name (or "workspace/project" format)
api_url str http://localhost:8000/api/v1 Backend API base URL
name str | None None Optional run name
api_token str | None None Reserved for future authentication

run.log(name, value, step=None)

Buffer a metric data point. Flushed to the backend every 5 seconds by a background thread.

run["key"] = {...}

Set run parameters via dict assignment. Values are type-inferred (int, float, bool, string).

run["parameters"] = {"lr": 0.001, "epochs": 10}
run["system"] = {"gpu": "A100", "framework": "pytorch"}

run.stop()

Flush remaining data and mark the run as completed. Called automatically via atexit if not called explicitly.

run.id

The integer run ID assigned by the backend.

How It Works

  • Metrics and params are collected in thread-safe buffers
  • A background daemon thread flushes every 5 seconds and sends heartbeats
  • Failed flushes re-add data to the buffer for retry
  • Requires Python 3.10+ and httpx

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

namaka-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

namaka-0.1.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file namaka-0.1.2.tar.gz.

File metadata

  • Download URL: namaka-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for namaka-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bcb03d47d068b22e34f46e5b7e0953bc912387a4ac6dcaf22fb46ea5d1d806f7
MD5 92eaffbbdbbe601441dbfcf4784f893d
BLAKE2b-256 62a26cd48f918bd0f9bd139b7853390849d02ea3fa0f5fda0900e9d2a5347dbb

See more details on using hashes here.

File details

Details for the file namaka-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: namaka-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for namaka-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 19abffb4fdbdad5b7faa84e2b3d470a095d1090223f22b1e7bda0b9f500b4c4a
MD5 8fa1949690f9e7614900f588fcfb62af
BLAKE2b-256 9c787f07ac95a3d9b4680cc75b657997257413729dcf9334286a8565463324ea

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