A Type-Safe UI/CLI Generator powered by Pydantic.
Project description
Typerform
A Type-Safe UI/CLI Generator powered by Pydantic and Prompt-Toolkit.
Typerform transforms your Pydantic models into professional, interactive CLI wizards. Stop writing boilerplate input loops and manual validation—let your schemas drive the user experience.
Features
| Feature | Description |
|---|---|
| Zero Boilerplate | Just one line of code to generate an entire multi-step wizard. |
| Type-Safe | Inherits all constraints (min_length, ge, EmailStr) from Pydantic. |
| Backtracking | Full backtracking support—type :b or :back to edit previous fields. |
| Conditional Logic | Dynamically skip fields based on previous answers using 'when' metadata. |
| Secure by Default | Automatic masking for SecretStr fields (API keys, passwords). |
| Enterprise Ready | Pluggable prompt engines for 100% automated testing in CI/CD. |
| Smart Autocomplete | Fuzzy search and real-time suggestions for Enums and Literals. |
| Hydration | Pre-fill forms from Environment variables or configuration files. |
Installation
pip install typeform
Quick Start
from typing import Literal
from pydantic import BaseModel, Field
from typeform import form
class SetupConfig(BaseModel):
project_name: str = Field(description="Project Name", min_length=3)
environment: Literal["dev", "staging", "prod"] = Field(default="dev")
enable_telemetry: bool = Field(default=True, description="Enable Telemetry")
# Generate the wizard!
config = form(SetupConfig, title="Project Setup")
print(config.model_dump())
Advanced Usage
Backtracking and Navigation
Typerform maintains a navigation stack. At any prompt, you can use special commands:
:backor:b- Move to the previous field.:?- Show extended help text (if provided injson_schema_extra).
Conditional Logic
Hide or show fields dynamically based on the current state of the form:
class CloudConfig(BaseModel):
provider: Literal["aws", "gcp"]
# Only asked if provider is 'aws'
aws_region: str = Field(
"us-east-1",
json_schema_extra={"when": "provider == 'aws'"}
)
Collection Wizard (Lists)
Typerform handles List[T] by entering a collection loop:
class Team(BaseModel):
members: list[str] = Field(description="Team Members")
# User will be prompted to add multiple items sequentially.
Hydration (Auto-filling)
Speed up workflows by pre-filling fields from the environment:
import os
config = form(MyModel, hydrate_from=[os.environ])
Contributing
Contributions are welcome! Whether it's bug reports, feature requests, or new prompt engines.
git clone https://github.com/sthitaprajnas/typeform.git
cd typeform
pip install -e ".[dev]"
pytest # run test suite
ruff check src/typeform # lint
mypy src/typeform # type-check
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright (c) 2026 Sthitaprajna Sahoo and contributors.
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
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 pytypeform-0.2.0.tar.gz.
File metadata
- Download URL: pytypeform-0.2.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c76d553c08e2513a72c11a7444a7b13c7fb20d3cc8bfa232322f4f913bf9425a
|
|
| MD5 |
51e57243a59a9b7f8c7cc8871ff872cb
|
|
| BLAKE2b-256 |
f635171efc3434c09b6a17e323dd4631d3069cc4dad5aab0d0cdd688ed8a641d
|
Provenance
The following attestation bundles were made for pytypeform-0.2.0.tar.gz:
Publisher:
release.yml on STHITAPRAJNAS/typeform
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytypeform-0.2.0.tar.gz -
Subject digest:
c76d553c08e2513a72c11a7444a7b13c7fb20d3cc8bfa232322f4f913bf9425a - Sigstore transparency entry: 1277555902
- Sigstore integration time:
-
Permalink:
STHITAPRAJNAS/typeform@932ab0fac77ec7747e3774bed7361a06e13b04d5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/STHITAPRAJNAS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@932ab0fac77ec7747e3774bed7361a06e13b04d5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytypeform-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pytypeform-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a03e302239d1fdbd6beff632ebb5aaf40c6f71e3cf6c93531a50c4fcd5ff88c
|
|
| MD5 |
274c5c27cb4b4b63f156c70c7deb06ad
|
|
| BLAKE2b-256 |
235e3f7525e35506ba44494c9168035dbb5a99d5e1f467e550f9d00b40e68dd5
|
Provenance
The following attestation bundles were made for pytypeform-0.2.0-py3-none-any.whl:
Publisher:
release.yml on STHITAPRAJNAS/typeform
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytypeform-0.2.0-py3-none-any.whl -
Subject digest:
9a03e302239d1fdbd6beff632ebb5aaf40c6f71e3cf6c93531a50c4fcd5ff88c - Sigstore transparency entry: 1277555935
- Sigstore integration time:
-
Permalink:
STHITAPRAJNAS/typeform@932ab0fac77ec7747e3774bed7361a06e13b04d5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/STHITAPRAJNAS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@932ab0fac77ec7747e3774bed7361a06e13b04d5 -
Trigger Event:
push
-
Statement type: