Skip to main content

Casca

A lightweight, zero-dependency Python TUI framework

⚠️ Note: This project is currently private. It will be made public on GitHub soon.

Build beautiful terminal user interfaces with CSS-like styling and a DOM-like widget tree.

Python Version License


Features

  • Zero Dependencies - Standard library only
  • CSS-Like Styling - Familiar selector syntax
  • Flexbox Layouts - Row/column with percentage sizing
  • 20+ Widgets - Buttons, inputs, tables, trees, dialogs
  • Full Type Hints - Complete mypy support
  • Built-in Logging - Structured debug output

Quick Start

pip install casca
from casca import App, Container, Label, run_app

CSS = """
#root {
    border: solid;
    border-color: cyan;
    padding: 1;
}
"""

ui = Container(
    Label("Hello from Casca!"),
    id="root",
)

run_app(ui, css=CSS)

What's Included

Basic Widgets: Container, Label, Button, Card, ScrollView

Forms: Input, TextArea, Select, Checkbox, RadioGroup

Data: ListView, DataGrid, Table, TreeView

Advanced: VirtualScrollView (10K+ items), Grid layout, Dialogs, Toasts


Documentation


Example

from casca import App, Container, Label, Input, Button

class LoginApp(App):
    def build_ui(self):
        return Container(
            Label("🔐 Login"),
            Input(placeholder="Username"),
            Input(placeholder="Password"),
            Button("Login", on_click=self.login),
            id="root",
        )
    
    def login(self, event):
        self.show_toast("Welcome!", level="info")

LoginApp().run()

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Lint
ruff check casca/

# Type check
mypy casca/

Stats

  • Tests: 450+
  • Coverage: 75%+
  • Type Coverage: 100% (core)
  • Dependencies: 0 (runtime)

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Add tests for new features
  4. Submit a PR

See CONTRIBUTING.md for details.


License

MIT License - See LICENSE for details.


Built with ❤️ using Casca

Metadata

Release files for casca 1.0.4

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

Source distribution (sdist)

Source distribution for casca 1.0.4
File Size Uploaded
casca-1.0.4.tar.gz 130.8 kB Details

Built distribution (wheel)

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

Total release size: 249.0 kB

Release files / casca-1.0.4.tar.gz

Download URL casca-1.0.4.tar.gz
Size 130.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2f320f65a1872ee876b49bd4055323048d6d0d4814f1a477474edfd524bdfcfe
BLAKE2b-256 checksum
How to use checksums
0f6ee8bdb1fbc4c6cd652931238aa1b2de72c4565fec87866ff83e3222a0a229
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / casca-1.0.4-py3-none-any.whl

Download URL casca-1.0.4-py3-none-any.whl
Size 118.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90b4946493ba6052f42d0d7d5f24f271a1978da1bd8d6fe0d3cc63ee6bd19d72
BLAKE2b-256 checksum
How to use checksums
9681193aa75fe57710540f41b0ef80e50682037801d479319a1d55b035d64195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.0

2 release files

0.1.0

2 release files

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