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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| casca-1.0.4.tar.gz | 130.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|