Skip to main content

Sparcli

Sparcli is a library for visualising metrics on the command line.

Use this library to see the shape of data during execution of data pipelines, simulators and other long-running programs. Each metric is displayed as a sparkline that updates as the data changes. Sparcli is thread-safe and non-blocking.

Build Publish Canary build

Usage

Sparcli is available on pypi:

pip install sparcli

You can wrap an iterable that produces scalars:

import sparcli, time

for y in sparcli.gen(ys, name="y"):
    do_something(y)

You can produce metrics using a context manager:

with sparcli.ctx() as ctx:
    for a, b in do_something_else():
        ctx.record(a=a, b=b)

You can also manage the context manually. Just don't forget to close it:

class MyMetricsPlugin:
    def start(self):
        self.ctx = sparcli.context()

    def callback(self, metrics: Dict[str, Real]):
        self.ctx.record(**metrics)

    def stop(self):
        self.ctx.close()

some_library.register_plugin(MyPlugin())

Development

pip install --user py-make poetry
poetry install
pymake all
poetry run python demo.py

Metadata

Release files for sparcli 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sparcli 0.1.3
File Size Uploaded
sparcli-0.1.3.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sparcli 0.1.3
File Interpreter ABI Platform
sparcli-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / sparcli-0.1.3.tar.gz

Download URL sparcli-0.1.3.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b421fc6c3c46ef548c9a4515324ceb831a4814eff4516ffda47822e824b90fb0
BLAKE2b-256 checksum
How to use checksums
647247b6cb63473c41134e5351f5902a1a5177bceb310ecdca5f926a43f1f171
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.1 Linux/5.0.0-1031-azure

Release files / sparcli-0.1.3-py3-none-any.whl

Download URL sparcli-0.1.3-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
615b15876986e455472044bb43e371eff47387fa91fcfa98c186ee1a37d542ab
BLAKE2b-256 checksum
How to use checksums
cc7bd457f1e2797bd38db5ee6bc0a5a87bce3368358c7cae86d9a45d2d9ce300
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.1 Linux/5.0.0-1031-azure

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.1

2 release files

0.1.0

2 release 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