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
Metadata
Release files for namaka 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| namaka-0.1.2.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| namaka-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / namaka-0.1.2.tar.gz
| Download URL | namaka-0.1.2.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcb03d47d068b22e34f46e5b7e0953bc912387a4ac6dcaf22fb46ea5d1d806f7
|
|
BLAKE2b-256 checksum How to use checksums |
62a26cd48f918bd0f9bd139b7853390849d02ea3fa0f5fda0900e9d2a5347dbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|
Release files / namaka-0.1.2-py3-none-any.whl
| Download URL | namaka-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19abffb4fdbdad5b7faa84e2b3d470a095d1090223f22b1e7bda0b9f500b4c4a
|
|
BLAKE2b-256 checksum How to use checksums |
9c787f07ac95a3d9b4680cc75b657997257413729dcf9334286a8565463324ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|