Skip to main content

FSTUI - Filesystem and Form UI Tools

Python 3.13+ Textual

Interactive TUI (Terminal User Interface) tools for:

  1. File Packaging - Create ZIP/TAR archives with custom directory structures
  2. Form Generation - Auto-generate forms from Pydantic models

📦 Installation

# Clone and install
git clone <repository>
cd fstui
uv venv
uv pip install -e .

🚀 Quick Start

File Packaging

Create custom archives with drag-and-drop style operations:

# Package files interactively
uv run fstui package /path/to/source

Features:

  • Dual-panel interface (source | destination)
  • Add files/folders (a)
  • Create folders (n)
  • Rename items (r)
  • Delete items (d)
  • Export as ZIP or TAR.GZ

Form Generation

Create New Models

from fstui import create_model
from pydantic import BaseModel

class User(BaseModel):
    name: str
    email: str
    age: int

# Interactive form
user = create_model(User)
if user:
    print(f"Created: {user.name}")

Edit Existing Models

from fstui import update_model, show_changes

# Load existing data
user = User(name="Alice", email="alice@example.com", age=30)

# Edit interactively
updated = update_model(user)
if updated:
    show_changes(user, updated)

Run Examples

# Form examples
uv run fstui form --example task
uv run fstui form --example blog

# Edit examples
uv run fstui edit task
uv run fstui edit blog

📚 Project Structure

fstui/
├── fstui/              # Core package
│   ├── __init__.py     # Public API
│   ├── packager.py     # File packaging widget
│   ├── form_generator.py  # Form generation widget
│   └── model_app.py    # create_model/update_model functions
├── examples/           # Example models and demos
│   ├── example_models.py
│   ├── form_app.py
│   └── edit_demo.py
├── tests/              # Test files
│   ├── test_list_parsing.py
│   └── test_list_widget.py
├── docs/               # Documentation
│   ├── MODEL_APP_API.md
│   ├── QUICKSTART.md
│   └── ...
├── main.py             # CLI entry point
└── README.md           # This file

🎯 API Reference

File Packaging

from fstui import FilePackager
from textual.app import App

class MyApp(App):
    def compose(self):
        yield FilePackager("/path/to/source")

app = MyApp()
app.run()

Form Generation - Main API

from fstui import create_model, update_model, show_changes

# Create
new_instance = create_model(ModelClass)

# Update
updated_instance = update_model(existing_instance)

# Show changes
show_changes(original, updated)

Form Generation - Advanced

from fstui import PydanticFormGenerator, ModelFormApp

# Custom form widget
form = PydanticFormGenerator(ModelClass, initial_data={...})

# Custom app
app = ModelFormApp(ModelClass, model_instance=existing)
result = app.run()

📖 Documentation

🔧 Supported Field Types

Type Widget Notes
str Input TextArea for long text
int, float Input Numeric validation
bool Switch Toggle on/off
Enum Select Dropdown menu
date Input YYYY-MM-DD format
list[T] Input Comma-separated
Optional[T] Any Allow blank

Markdown Support: Fields named description, content, notes or with json_schema_extra={"format": "markdown"} use a TextArea widget.

💡 Examples

Task Management

from enum import Enum
from pydantic import BaseModel
from fstui import create_model

class Priority(Enum):
    LOW = "low"
    HIGH = "high"

class Task(BaseModel):
    title: str
    priority: Priority
    completed: bool = False

task = create_model(Task)

Blog Post Editor

from datetime import date
from pydantic import BaseModel, Field
from fstui import update_model

class BlogPost(BaseModel):
    title: str
    content: str = Field(..., json_schema_extra={"format": "markdown"})
    published_date: date

post = BlogPost(title="Hello", content="# Welcome\n\nHello world!", published_date=date.today())
updated = update_model(post)

🐛 Known Issues

All major bugs have been fixed:

  • ✅ Enum select values
  • ✅ PydanticUndefined handling
  • ✅ List field parsing
  • ✅ Optional[list[T]] support

See docs/FORM_FIXES.md for details.

🤝 Contributing

Contributions welcome! Please check the project structure and follow existing patterns.

📄 License

[Add license information]

🙏 Acknowledgments

Built with:

Metadata

Release files for fstui 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fstui 0.1.1
File Size Uploaded Provenance Actions
fstui-0.1.1.tar.gz 80.7 kB Without provenance Details for fstui-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fstui 0.1.1
File Interpreter ABI Platform Actions
fstui-0.1.1-py3-none-any.whl Python 3 none any Details for fstui-0.1.1-py3-none-any.whl

Total release size: 99.4 kB

Release files / fstui-0.1.1.tar.gz

Download URL fstui-0.1.1.tar.gz
Size 80.7 kB
Tags Source
SHA-256 checksum
How to use checksums
01be531545b708b837b1b3f31891a976b27b1d02d6bb8328e6f5ffd6dee6123f
BLAKE2b-256 checksum
How to use checksums
1e1cab0a98600127939a5a1bb147e09e014b9167c774719ead812a1f3f6e76d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / fstui-0.1.1-py3-none-any.whl

Download URL fstui-0.1.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75750f538b744717a05f2a119d379df05e3808025ccd362a90cb0d460028a876
BLAKE2b-256 checksum
How to use checksums
d81db6c53585c765acaf25ddbb7f7441e4505481c3177f57c2cd14a3f81ebfc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Security for fstui 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page