Skip to main content

Native Python CLI UI library with CSS-like styling

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

casca-1.0.2.tar.gz (130.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

casca-1.0.2-py3-none-any.whl (118.2 kB view details)

Uploaded Python 3

File details

Details for the file casca-1.0.2.tar.gz.

File metadata

  • Download URL: casca-1.0.2.tar.gz
  • Upload date:
  • Size: 130.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for casca-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7d13b7c3d02632e53ede5d31418495ca812812bd41b80ae1da78b58a0bbd641a
MD5 3764100d364e4152c7bbfe41318a8726
BLAKE2b-256 b144c68cb9bdd833377dd4944d486a7baf7eb99210cf8ed39dc4f6894e753d85

See more details on using hashes here.

File details

Details for the file casca-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: casca-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 118.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for casca-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d7046c01b58f204f0b51bef55226697de0b915c3e646cb836f13f2b5385ab11e
MD5 fcc8504ba39ec77ce348a6b77c446f01
BLAKE2b-256 06292236fb22315a264c32f4e663c101278cb015d57662d4b053e5f8b974b0b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page