Skip to main content

Anvil

Anvil

Styled console output for Python. Zero dependencies.

Install

pip install anvil

Usage

from anvil import console as ui

Messages

ui.info("loading config")
# → loading config

ui.success("done")
# ✓ done

ui.warning("file is outdated")
# ! file is outdated

ui.error("connection failed")
# ✗ connection failed

ui.step("intermediate step")
# · intermediate step

ui.debug("value x = 42")  # only when verbose=True
# · value x = 42

Sections

ui.title("Setup")

with ui.section("Check dependencies"):
    ui.step("python3")
    ui.step("git")

# output:
# ─────────────────────────
# Setup
# ─────────────────────────
# Check dependencies
#   · python3
#   · git

Spinner

with ui.spinner("connecting to server") as sp:
    connect()
    sp.set_final("connected")

# output during work:
# ⟳ connecting to server

# output after completion:
# ✓ connected

Progress

files = ["a.txt", "b.txt", "c.txt"]
with ui.progress("copying files", total=len(files)) as bar:
    for i, f in enumerate(files, 1):
        copy(f)
        bar.update(i)

# output:
# copying files  ████████░░░░░░░░░░░░░░░░  50% (2/3)

Task

with ui.task("Compile project"):
    build()

# output on success:
# ✓ Compile project (2.3s)

# output on failure:
# ✗ Compile project
# ✗ connection failed

Numbered steps

steps = ["Download", "Extract", "Check", "Install"]
for i, name in enumerate(steps, 1):
    with ui.numbered_step(i, len(steps), name):
        do_step(i)

# output:
# [1/4] Download
# [2/4] Extract
# [3/4] Check
# [4/4] Install

Info block

ui.info_block("my-package", {"mp3": 12, "txt": 3}, footer="total 15 files")

# output:
# ─────────────────────────
# my-package
# mp3 12 · txt 3
# total 15 files
# ─────────────────────────

Table

ui.table(["File", "Size", "Status"], [
    ["a.mp3", "3.2 MB", "ok"],
    ["b.txt", "1 KB", "ok"],
])

# output:
# File       Size   Status
# ─────────────────────────
# a.mp3      3.2 MB ok
# b.txt      1 KB   ok

Box

ui.box("Warning: action cannot be undone!", style="warn")

# output:
# ┌──────────────────────────┐
# │ Warning: action cannot be undone! │
# └──────────────────────────┘

Input

name = ui.ask("Enter name", default="guest")
# Enter name [guest]: →

ok = ui.confirm("Continue?", default=True)
# Continue? [Y/n]: →

choice = ui.select("Environment", ["dev", "staging", "prod"])
# Environment
#   1) dev
#   2) staging
#   3) prod
# Your choice [1-3, default 1]: →

secret = ui.password("Access token")
# Access token: →

Timer

with ui.timer("full run"):
    do_everything()

# output:
# · full run: 12.5s

Run wrapper

def main():
    ...

if __name__ == "__main__":
    ui.run(main)

Catches Ctrl+C and unhandled exceptions. Exits with code 130 on interrupt, 1 on error.

Environment

Variable Effect
NO_COLOR=1 No color
NO_MOTION=1 No animation
No TTY Animation disabled
No truecolor 16-color fallback
No UTF-8 ASCII fallback

Singleton

from anvil import console, get_manager

ui = console
ui = get_manager()

License

MIT - see LICENSE.

Metadata

Release files for anvil-atui 1.0.0

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

Source distribution (sdist)

Source distribution for anvil-atui 1.0.0
File Size Uploaded Provenance Actions
anvil_atui-1.0.0.tar.gz 7.9 kB With provenance Details for anvil_atui-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anvil-atui 1.0.0
File Interpreter ABI Platform Actions
anvil_atui-1.0.0-py3-none-any.whl Python 3 none any Details for anvil_atui-1.0.0-py3-none-any.whl

Total release size: 16.2 kB

Release files / anvil_atui-1.0.0.tar.gz

Download URL anvil_atui-1.0.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
92e58da93b0596ac1a9161896685108dea67084e4fb9a1cca67d7db49af4150f
BLAKE2b-256 checksum
How to use checksums
d1ee888a602522c8d2221d548fa1a757e3cfaab1f0242d87013f433ea7764295
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / anvil_atui-1.0.0-py3-none-any.whl

Download URL anvil_atui-1.0.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e043aad34e04566d9762fc4c24d1a3b4d81b50194072757dec46d6f52b8b442
BLAKE2b-256 checksum
How to use checksums
0849a8421ac16e2d508f31a903f3ff2ab7ee74acb70d37aa3d2f7963f8774790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Security for anvil-atui 1.0.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for anvil_atui-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

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