
Security News
Knip Hits 500 Releases with v5.62.0, Improving TypeScript Config Detection and Plugin Integrations
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Dynamic forms for Textual TUI framework.
Note: This library is still very much WIP 🧪. This means that breaking changes can be introduced at any point in time.
Textual Forms aims to make it easy to add forms to your Textual-powered applications.
pip install textual-forms
textual_forms.forms.Form
textual_forms.buttons.Button
textual_forms.fields.StringField
textual_forms.fields.NumberField
textual_forms.fields.IntegerField
from __future__ import annotations
from typing import Any
from textual_forms.fields import Field
from textual_forms.validators import FieldValidator
class UUIDValidator(FieldValidator):
def validate(self, value: str, rules: dict[str, Any]) -> tuple[bool, str | None]:
return True, None
class UUIDField(Field):
validator = UUIDValidator()
def __init__(
self,
name: str,
*,
value: str | None = None,
required: bool = False,
placeholder: str | None = None,
**kwargs,
):
data: dict[str, Any] = {
"name": name,
"value": value,
"required": required,
"placeholder": placeholder,
"rules": {},
}
super().__init__(data, **kwargs)
from rich.table import Table
from textual.app import App, ComposeResult
from textual.widgets import Static
from textual_forms.forms import Form
from textual_forms.fields import StringField, IntegerField
from textual_forms.buttons import Button
class BasicTextualForm(App):
def compose(self) -> ComposeResult:
yield Static(id="submitted-data")
yield Static("Order for beers")
yield Form(
fields=[
StringField("name"),
IntegerField("age", required=True, min_value=21),
],
buttons=[
Button(
"Submit",
enabled_on_form_valid=True,
)
],
)
def on_form_event(self, message: Form.Event) -> None:
if message.event == 'submit':
table = Table(*message.data.keys())
table.add_row(*message.data.values())
self.query_one('#submitted-data').update(table)
if __name__ == '__main__':
BasicTextualForm().run()
Initial render
Valid form
Invalid form
TBD
FAQs
Dynamic forms for Textual TUI Framework
We found that textual-forms demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.