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.4.tar.gz (130.8 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.4-py3-none-any.whl (118.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: casca-1.0.4.tar.gz
  • Upload date:
  • Size: 130.8 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.4.tar.gz
Algorithm Hash digest
SHA256 2f320f65a1872ee876b49bd4055323048d6d0d4814f1a477474edfd524bdfcfe
MD5 3ddbe9efc07a5d4397d5c247e7c98c22
BLAKE2b-256 0f6ee8bdb1fbc4c6cd652931238aa1b2de72c4565fec87866ff83e3222a0a229

See more details on using hashes here.

File details

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

File metadata

  • Download URL: casca-1.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 90b4946493ba6052f42d0d7d5f24f271a1978da1bd8d6fe0d3cc63ee6bd19d72
MD5 482f08d4f03ef50e057c8e3053ffb29a
BLAKE2b-256 9681193aa75fe57710540f41b0ef80e50682037801d479319a1d55b035d64195

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