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.
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
- Website: https://casca.abdallahzain.dev/
- API Reference: https://casca.abdallahzain.dev/docs.html
- Examples: https://casca.abdallahzain.dev/examples.html
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
- Fork the repo
- Create a feature branch
- Add tests for new features
- Submit a PR
See CONTRIBUTING.md for details.
License
MIT License - See LICENSE for details.
Built with ❤️ using Casca
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file casca-1.0.3.tar.gz.
File metadata
- Download URL: casca-1.0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a39b248cdc2eb89e48bce49770f706918b6443906ee86b6a74db73de18cf533
|
|
| MD5 |
1328633e0b64b0fd5acea45e81504c2c
|
|
| BLAKE2b-256 |
f7ceacb8b0928f8241e75415234ce20011b1b539f58243a503bcabe83f0f4519
|
File details
Details for the file casca-1.0.3-py3-none-any.whl.
File metadata
- Download URL: casca-1.0.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
781a4276c94ec7c40830cf61feffd12553a345f9bf285d49b1ad7a6650d1408d
|
|
| MD5 |
3c679b4bff83d97bd9fbfb1626a602e3
|
|
| BLAKE2b-256 |
b97617448cdc0d7419882d2486522620ae0c131ea12f58d4e096ebb4af536d08
|