spinlog.py
Spinner Logger for Python
Installation
Just pip install spinlog and you can use it.
Usage
Spinlog is build on top of halo providing a different API to interact with the spinner.
Basic Usage
from spinlog import Spinner
from time import sleep
print("About to launch Spinner")
with Spinner.get("I'm spinning around") as s:
sleep(2)
s.info("Here is an info message while spinning around")
# you can use s.warn, s.error, or s.debug
sleep(2)
print("Spinning Over")
Advanced usage
Spinlog is build in such a manner that you can disable the spinning animation and replace it with proper logging without having to change the codebase.
This is done by creating a spinner instance, potentialy configured with two logger,
the concommitant_logger to be run alongside the spinner (for logging to file for instance),
and the alternative_logger to replace spinner animation and logging.
A complete example can be found in the examples folder Here is an except:
# imports and logger definitions
should_spin = "--no-spin" not in sys.argv
# Configure spinner
spinner = Spinner(spinner="triangle", is_spinning=should_spin,
alternative_logger=stream_logger, concommitant_logger=file_logger)
# Use spinner
with spinner("Operation in progress") as s:
sleep(2)
s.info("Checkpoint reached")
sleep(2)
Licence
MIT © AdrieanKhisbe
Metadata
Release files for spinlog 0.3.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 |
|---|---|---|---|---|
| spinlog-0.3.0.tar.gz | 3.3 kB | Without provenance | Details for spinlog-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spinlog-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for spinlog-0.3.0-py3-none-any.whl |
Total release size: 7.0 kB
Release files / spinlog-0.3.0.tar.gz
| Download URL | spinlog-0.3.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a260cac732f3dd381bcf24e765bc0cb387ce16cc2d41f8313b0350c5e5417355
|
|
BLAKE2b-256 checksum How to use checksums |
b4f63e6c2119cc69a99179cfdd0e3304e9cbeceb1a807724c9c3a2de157279db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
|
Release files / spinlog-0.3.0-py3-none-any.whl
| Download URL | spinlog-0.3.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50334fbefdc9fca2e7cec65df689ecbd9baeee7d88faaee8a80447e812381ba4
|
|
BLAKE2b-256 checksum How to use checksums |
a1160cafe5876611a5a02a12e82196661602587047221ea50f9205d5c6f30f9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
|
Security for spinlog 0.3.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.