Reusable live statistics and progress display for CLIs.
Project description
archiver-stats
Reusable live statistics and progress display for archiver-style CLIs.
Installation
pip install archiver-stats
Usage
Declare counters and optional free-form status lines, then drive a live Rich display from the
Stats instance:
import sys
from archiver_stats import Category, Stats, StatusDisplay, StatusLine
stats = Stats(
(Category('hits', 'Hits:'), Category('misses', 'Misses:')),
status_lines=(StatusLine('progress', 'Progress:', after='hits'),),
)
display = StatusDisplay(stats, stream=sys.stderr, initial_message='Working...')
display.start()
try:
stats.increment('hits')
stats['progress'] = 'https://example.com/1 (1/3)'
display.refresh()
finally:
display.stop()
Stats is a MutableMapping keyed by category or status-line key. Counter values are integers
(update with stats[key] = value or stats.increment(key, amount)), and status-line values are
str or None. Keys are fixed at construction time and the mapping does not support deletion.
StatusDisplay wraps a Rich Live display: call start() and stop() around your work,
refresh() to re-render after updating counters, set_message() to change the spinner text, and
write() to print a persistent line above the live region.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file archiver_stats-0.0.1.tar.gz.
File metadata
- Download URL: archiver_stats-0.0.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abd393d86c62f10c1c7ec6a7baae83cb078dac372348a89506aebef89f3359fd
|
|
| MD5 |
46dbbc036d17573ce135b1d46b6264a7
|
|
| BLAKE2b-256 |
4495925156ac4a72b7a01f378acad2eeaf7deed7a3d55090e752a4b7eb58786d
|
Provenance
The following attestation bundles were made for archiver_stats-0.0.1.tar.gz:
Publisher:
publish.yml on Tatsh/archiver-stats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archiver_stats-0.0.1.tar.gz -
Subject digest:
abd393d86c62f10c1c7ec6a7baae83cb078dac372348a89506aebef89f3359fd - Sigstore transparency entry: 1324933286
- Sigstore integration time:
-
Permalink:
Tatsh/archiver-stats@5a2148c55d05e7a14edc7f285c6704e07fa8c708 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/Tatsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a2148c55d05e7a14edc7f285c6704e07fa8c708 -
Trigger Event:
push
-
Statement type:
File details
Details for the file archiver_stats-0.0.1-py3-none-any.whl.
File metadata
- Download URL: archiver_stats-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be9df65fdb71667970464132901c2d51180804d95405d4aac9558ff3cf324fd4
|
|
| MD5 |
5ca8737f76e633a2ba6735d56d5a9462
|
|
| BLAKE2b-256 |
72f1919ef4b3a15afc9c0286e0fe7f71c584712a2289654da70be542ba0f5857
|
Provenance
The following attestation bundles were made for archiver_stats-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on Tatsh/archiver-stats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archiver_stats-0.0.1-py3-none-any.whl -
Subject digest:
be9df65fdb71667970464132901c2d51180804d95405d4aac9558ff3cf324fd4 - Sigstore transparency entry: 1324933419
- Sigstore integration time:
-
Permalink:
Tatsh/archiver-stats@5a2148c55d05e7a14edc7f285c6704e07fa8c708 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/Tatsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a2148c55d05e7a14edc7f285c6704e07fa8c708 -
Trigger Event:
push
-
Statement type: