docbrown
docbrown is an empirical progress library. It determines the overall duration and progression of a process by looking at the time it took in the past.
docbrown might be an option for you, if you have one long running task which parts take very different amounts of time. It is also helpful when used in environments where you can’t inform consumers about the progress of a task out-of-band (like a WSGI request/response cycle vs a WebSocket).
Example Usage
Record progress:
import time
from docbrown import record_progress
with record_progress('process_name', ident='my_ident') as record:
# outputs "my_ident", but normally would return a
# unique id if not set manually
print(record.ident)
# do some stuff that takes time
record('loading_data')
time.sleep(4)
record('calculating_matrices')
time.sleep(9)
record('rendering_structures')
time.sleep(23)
record('uploading_models')
time.sleep(15)
As docbrown determines progression by looking at the past every process needs
to run at least once before. The following get_progress call will therefore only
work if you’ve executed the code above at least once!
Get the progression of our process in another process:
from docbrown import get_progress
print(get_progress('my_ident'))
Future
There are some things that would be nice, but have not been implemented yet.
- additional storage backends apart from SQLite
- configurable strategy for aggregating phase durations apart from the simple arithmetic average like median
- code path detection that takes optional phases into account and updates the expected duration and progres on-the-fly
Metadata
Release files for docbrown 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| docbrown-0.1.0.tar.gz | 18.1 kB | Without provenance | Details for docbrown-0.1.0.tar.gz |
Release files / docbrown-0.1.0.tar.gz
| Download URL | docbrown-0.1.0.tar.gz |
|---|---|
| Size | 18.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
405b504568477747b8de79d9c1bf5f4239a365ff413c508280a4230ff9c87d32
|
|
BLAKE2b-256 checksum How to use checksums |
84702b71ae92e2406cc8d4991636e6923dcdf4fce0be7a475bd7e3c3c8b8172e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4
|
Security for docbrown 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.