Skip to main content
Users of our Python client library can generate pydantic models to help with validating and consuming the API response in a type-safe way. Use the generate_models command to auto-generate pydantic models from your document type configuration.

Pydantic models

For example, this will generate pydantic models for your workspace:
You will be prompted for your API key, unless you already have the AFFINDA_API_KEY environment variable set. The generated pydantic model(s) will be in ./affinda_models by default. For the list of options available, run:

Example of using the generated pydantic models