Skip to main content

Typerform

A Type-Safe UI/CLI Generator powered by Pydantic and Prompt-Toolkit.

PyPI version Python CI License Typed

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 pytypeform

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:

  • :back or :b - Move to the previous field.
  • :? - Show extended help text (if provided in json_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.

Release files for pytypeform 0.2.3

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

Source distribution (sdist)

Source distribution for pytypeform 0.2.3
File Size Uploaded
pytypeform-0.2.3.tar.gz 12.0 kB Details

Built distribution (wheel)

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

Total release size: 22.3 kB

Release files / pytypeform-0.2.3.tar.gz

Download URL pytypeform-0.2.3.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c22a82a747cef12b5c5b992577a529cf2f27b0daafd4c244c9f6d666a028b770
BLAKE2b-256 checksum
How to use checksums
c54ca60b4fa1029924044cf459e471b46fed6f65dd3969a5b05b42e40561eb10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 11, 2026.

Transparency log

Release files / pytypeform-0.2.3-py3-none-any.whl

Download URL pytypeform-0.2.3-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da8ba4a49ceb4c7f5b40ae61c9078c8ede1404a773e6b024158c03fd39fdc7bc
BLAKE2b-256 checksum
How to use checksums
5b7c09ea0632978e0bbe7d806a47c195299baa3e24f6738243632664f50d0852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

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