Skip to main content

logupdate.py

PyPI Supported Python Versions Build Status

Log by overwriting the previous output in the terminal. Useful for rendering progress bars, animations, etc. (Port of sindresorhus/log-update from js to python)

Install

Just pip install it, and you're good to go.

pip install logupdate

Usage

from logupdate import logupdate
from time import sleep

logupdate("Hello, a secret is about to be said to you")
sleep(1)
logupdate("You can pimp your interactive commands with logupdate")
sleep(1)
logupdate("Don't forget the secret ;)")
sleep(1)
logupdate.clear().done()

Examples

You can find some example in the dedicated examples folder.

API

  • logupdate(text, ...): log to stdout (overwriting previous input)

  • logupdate.clear([restore_cursor=None]): Clear previous logged output. This can also restore the cursor if asked.

  • logupdate.done([restore_cursor=None]): Persist the logged output. This enable to start a new "log session" below. This restores the cursor unless you ask not to.

  • logupdate.stderr(text, ...): log to stderr

  • logupdate.stderr.clear([restore_cursor=None]): clear stderr.

  • logupdate.stderr.done([restore_cursor=None]): persist stderr.

  • logupdate.create(stream, [show_cursor=False]) : return a logupdate method dedicated to log to given stream.

License

MIT © AdrieanKhisbe

Metadata

Release files for logupdate 0.3.1

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

Source distribution (sdist)

Source distribution for logupdate 0.3.1
File Size Uploaded Provenance Actions
logupdate-0.3.1.tar.gz 4.2 kB Without provenance Details for logupdate-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 8.3 kB

Release files / logupdate-0.3.1.tar.gz

Download URL logupdate-0.3.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f21b70d18a4439a46b219487745e3c1a3d7e68d8625468a86d807220b377ac3a
BLAKE2b-256 checksum
How to use checksums
4b206e5cc1bfee5713da5b121d4d9b9ee07a5b575c6c00a61bc12b07d9701c55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.7 Darwin/19.4.0

Release files / logupdate-0.3.1-py3-none-any.whl

Download URL logupdate-0.3.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4596395de0802f438ed8673cf2718848f5e4d6d92ce029401e8f64dd3d3e805
BLAKE2b-256 checksum
How to use checksums
e318d158173c39a91e410e1f1b03f87c5adb6f7fd115fffb885da52048aefbfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.7 Darwin/19.4.0

Security for logupdate 0.3.1

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.

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