Skip to main content

Anvil

Anvil

Styled console output for Python. Zero dependencies.

Install

pip install anvil-atui

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 0.1.5

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 0.1.5
File Size Uploaded Provenance Actions
anvil_atui-0.1.5.tar.gz 10.7 kB With provenance Details for anvil_atui-0.1.5.tar.gz

Built distribution (wheel)

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

Total release size: 19.0 kB

Release files / anvil_atui-0.1.5.tar.gz

Download URL anvil_atui-0.1.5.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c7332dacc421cbe52fa9b4e73992c125d8c5f929824678b0a18604bb28d30c38
BLAKE2b-256 checksum
How to use checksums
a01a06120446f08349f0865ae04e9f6f21dd8e43a8d0e23f4187317f4efbdac7
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-0.1.5-py3-none-any.whl

Download URL anvil_atui-0.1.5-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16ff3144a6ce49ab66fa1a75783ffc998d68018cff9b696c1bf62b7840ecd185
BLAKE2b-256 checksum
How to use checksums
fca4c92c3e97a1b76bc2a7e3a8dccf968f958f34204792ddf6a2a11afbbeabb9
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 0.1.5

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-0.1.5.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

0.1.5 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