Skip to main content

Native Python CLI UI library with CSS-like styling

Project description

Casca

Casca is a lightweight, native Python TUI library with a DOM-like widget tree and CSS-style theming.

Features

  • Zero core dependencies (standard library runtime)
  • Declarative widgets (Container, Label, Input, Button, Card, Header, ScrollView)
  • CSS-like style parsing and cascade
  • Keyboard and mouse event handling in raw terminal mode
  • Real examples including login screen, dashboard, and Groq chatbot

Quick Start

from casca import Container, Label, run_app

CSS = """
#root {
    padding: 1;
    border: ascii;
}
"""



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

if __name__ == "__main__":
    run_app(ui_tree, css=CSS)

Run Use Cases

python3 -m use_cases.login_screen
python3 -m use_cases.dashboard
python3 -m use_cases.chatbot

use_cases.chatbot requires groq and a GROQ_API_KEY.

Project Layout

  • casca/: core library
  • use_cases/: real apps built with Casca
  • examples/: smaller demos
  • docs/: MkDocs content

License

MIT

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-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

casca-0.1.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for casca-0.1.0.tar.gz
Algorithm Hash digest
SHA256 11956c08f913c2baa570cd61e932d462d20c061b2d6da6b316e8b4eab0f7d749
MD5 1592fdccbed2757221752914b7d8b706
BLAKE2b-256 c2fac3ceb1cbd12ad221940d39d2cd1b7f7cf726e2212e4bfaee4d6fae2cd619

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for casca-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae508fde2f2adbcab83e36cc5309efff35f10aee9a564ee124c34acfbd5d7ac8
MD5 4b9b2feff9bedbbb9a1327b7fda35ca9
BLAKE2b-256 02828bb4fe49c0bf8e280b0089d58bdceb566b4666c35d5caa3208537a11f740

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