-
Notifications
You must be signed in to change notification settings - Fork 0
03_Status
Thomas Byr edited this page Jun 2, 2026
·
2 revisions
This module exposes the rich.status.Status class with some additional functions to make it easier to work with one status at a time (which we will call the global status).
Here, we will import the status module the following way, to still be able to use variable named status:
import nob.statusThe global status is not thread-safe.
Use new() to create a new status and set it as the global status.
nob.status.new()You can also specify the following parameters when creating a new status:
-
text: The text to display in the status. Defaults to "Loading...". -
spinner: The spinner to use. Defaults to "dots". -
style: The style of the status text. Defaults to "status.spinner". -
refresh_per_second: The number of times to refresh the status per second. Defaults to 12.5. -
speed_factor: The factor by which to adjust the speed of the spinner. Defaults to 1.0.
nob.status.start()
# do some work
nob.status.stop()or enter a context upon creation:
with nob.status.new():
# do some workYou can update each status field with new values, except for refresh_per_second.
nob.status.update("New status message")Upon creation:
status = nob.status.new()Then, you can interact with the status directly:
with status:
# do some work
status.update("New status message")Or shorter:
with nob.status.new() as status:
# do some work
status.update("New status message")Powered by caffeine and uv.
MIT license.