Skip to main content

naw

naw logs machine-learning time-series metrics to a compressed file on disk, and gives you a CLI to read them back.

It is two things in one package:

  • a storage library (naw.rtsdb) that writes typed, columnar, compressed rows to a single .rtsdb file, and reads them back — including while the file is still being written;
  • a wandb-compatible façade (naw.wandb) so that code already instrumented with wandb.init() / run.log() keeps working with nothing but an import change.

Full documentation: https://mlacage.gitlabpages.inria.fr/naw

Installation

$ pip install naw          # or: uv add naw

naw requires Python 3.10 or newer and pulls in three small dependencies (argcomplete, pyyaml, tabulate) — no NumPy. The plot and heatmap subcommands render through uniplot and matplotlib, which are not installed by default; get them with the plot extra:

$ pip install "naw[plot]"   # or: uv add "naw[plot]"

Log a run

import naw.wandb as wandb

run = wandb.init(project="demo", config={"lr": 3e-4})
for step in range(1000):
    run.log({"loss": loss})
run.finish()

init() creates <dir>/wandb/<project>/<id>.rtsdb. A run that is never finished is still readable — you just lose the summary.

init() also starts a background monitor that records GPU utilization, VRAM, power draw, temperature, ECC errors and throttling — plus host CPU, memory, disk and network — every ten seconds. NVIDIA counters come from libnvidia-ml.so.1 bound directly with ctypes, and the host counters from /proc and /sys, so this adds no dependencies and degrades to whatever the machine actually has. The samples are ordinary metric rows, so every subcommand below reads them:

$ naw plot wandb/demo/<run-id>.rtsdb -x _timestamp -y system.gpu.0.powerWatts --lines

Pass monitor_system=False (or set NAW_MONITOR_SYSTEM=0) to turn it off.

Read it back

Every subcommand takes the run filename as its first argument:

Command Description
naw metadata FILE Show the run's identity, configuration and final summary.
naw metrics FILE List the metric columns present in the run and their storage types.
naw watch FILE Print metric rows as they are written, then exit when the run closes.
naw plot FILE -y METRIC Plot one metric against another (terminal, matplotlib, SVG, PNG or CSV).
naw heatmap FILE -m METRIC Render a histogram metric as a 2-D density map over time.
$ naw plot wandb/demo/<run-id>.rtsdb -y loss --lines

How it compresses

Values are grouped by column rather than by row, and each column is encoded with a scheme suited to its type: integers as a delta against the previous row then LEB128 varint, floats as an XOR against the previous row's value then a varint over the resulting bit pattern, and float16/bfloat16 in 2 bytes. A step counter that increments by one costs a single byte per row.

The writer periodically emits a sync point carrying a schema index, so a reader that opens the file mid-run can seek to the last sync point instead of replaying the whole file. That is what makes naw watch a live tail rather than a repeated full parse.

Documentation

References

The XOR-then-varint idea is the one introduced by Gorilla and refined by Chimp and Elf; naw uses varint framing rather than these papers' bit-level framing, which keeps decoding cheap and the format simple to reason about.

  • Gorilla: A fast, scalable, in-memory time series database
  • Chimp: efficient lossless floating point compression for time series databases
  • Elf: Erasing-Based Lossless Floating-Point Compression

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

naw-0.0.8.tar.gz (52.0 kB view details)

Uploaded Source

Built Distributions

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

naw-0.0.8-py3-none-any.whl (56.5 kB view details)

Uploaded Python 3

naw-0.0.8-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (658.2 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

naw-0.0.8-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (663.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

naw-0.0.8-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (673.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

naw-0.0.8-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (633.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

naw-0.0.8-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (611.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file naw-0.0.8.tar.gz.

File metadata

  • Download URL: naw-0.0.8.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for naw-0.0.8.tar.gz
Algorithm Hash digest
SHA256 3d0fe12ef8594a49379c01fa861f1bdf28711d686748cae8f0e92dd57a3699d0
MD5 e6202443ab4ae0565204fd6c236aeb71
BLAKE2b-256 24d967344f48e4d20b52727204669db91c9e925e1292bf1636f01c213c9e3cc0

See more details on using hashes here.

File details

Details for the file naw-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: naw-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 56.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for naw-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4ae3a9dc5d558c0957aa7d92907ce36bd4e9eac4e8f797030582baa9258cbd07
MD5 b53bcb4291130a32c1a2f36fd9d6d7d6
BLAKE2b-256 54eb68e086adee63c3d897bd8aac458e18ca5a8a05e5e050e22deecdd2a7b360

See more details on using hashes here.

File details

Details for the file naw-0.0.8-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

  • Download URL: naw-0.0.8-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
  • Upload date:
  • Size: 658.2 kB
  • Tags: CPython 3.14, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for naw-0.0.8-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 09e11c37a20e08b41f2b01e2700cd7172e2898e7f4ea074ecc8a3ab842767efe
MD5 a7e98e4abab5b743d14be82768b19d22
BLAKE2b-256 cea0e17089d03ecb62792c6c8e35c0dc9289f2f4255bfc0f93ffb88d4b7cf7e7

See more details on using hashes here.

File details

Details for the file naw-0.0.8-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

  • Download URL: naw-0.0.8-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
  • Upload date:
  • Size: 663.5 kB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for naw-0.0.8-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 fe0e14519eea3e7bd94c69b8644ef114066009bd4fde1b427c48049e2e076744
MD5 100e8f061a9957e4d682c2b698581438
BLAKE2b-256 72ba213efa93f47252334961597b5724fe92b6a3733eb358646de57cfeed9e21

See more details on using hashes here.

File details

Details for the file naw-0.0.8-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

  • Download URL: naw-0.0.8-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
  • Upload date:
  • Size: 673.2 kB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for naw-0.0.8-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a4085e2de9a4f2ad798b4bb6f475f6363f7a5b3a16a486359f6e91ccf66e46fb
MD5 1583c2caa9e636a1bc7830f8f3ef9f95
BLAKE2b-256 7c0a1f8d85e3ebdf344531067ae34cd5fad1d5ff49ad9d7cbfeb2fdf0ed7980b

See more details on using hashes here.

File details

Details for the file naw-0.0.8-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

  • Download URL: naw-0.0.8-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
  • Upload date:
  • Size: 633.5 kB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for naw-0.0.8-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 64289242884c33edca13f6da01de6d44e7560a91a0919542680519c6be2454c4
MD5 fe269dd08a98b6b33f920402c0bfea0e
BLAKE2b-256 455baa119ab0249d4211333259c813e14ec338a934389cbab640493ef6707893

See more details on using hashes here.

File details

Details for the file naw-0.0.8-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

  • Download URL: naw-0.0.8-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
  • Upload date:
  • Size: 611.0 kB
  • Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for naw-0.0.8-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 b48de0be227f3088f11d7bddf5984336402137becfa0a660bd0a1c7f65b288a8
MD5 c4f1c58795afb5437a4941d652dee4b8
BLAKE2b-256 b4c35d11b9ad3eb52ce47aaf662274517dc1250b6183f0c4b4d09abcb0e09818

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.10

7 files

This release

0.0.8 This release

7 files

0.0.7

7 files

0.0.4

7 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page