Skip to main content

Robot Framework keyword library for validating data with Pydantic models and creating model instances dynamically.

Project description

robotframework-pydantic

Robot Framework keyword library for validating data with Pydantic models and creating model objects dynamically.

Usage

*** Settings ***
Library    PydanticLibrary    models=${CURDIR}/models.py

*** Test Cases ***
Validate Model
    &{item}=    Create Dictionary    product_id=101    name=Apple    quantity=3    unit_price=0.50
    @{items}=    Create List    ${item}
    &{data}=    Create Dictionary    cart_id=1    customer_name=Alice    items=${items}
    ${cart}=    Validate ShoppingCart    ${data}

Create Object
    ${obj}=    Create ShoppingCart    cart_id=1    customer_name=Alice    items=${items}
    Log    ${obj}

Model source

models can be either:

  • a path to a Python file (/path/to/models.py)
  • a Python module import path (my_project.models)

All classes in that module inheriting from pydantic.BaseModel are exposed as dynamic Validate <ModelName> and Create <ModelName> keywords.

Run tests

# Unit/integration tests
uv run pytest

# Robot acceptance tests
uv run robot --pythonpath src tests/acceptance

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

robotframework_pydantic-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_pydantic-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_pydantic-0.1.0.tar.gz.

File metadata

  • Download URL: robotframework_pydantic-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for robotframework_pydantic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e23935f87908c8f83190d3867ab4e6da663ef9f92f0527630980bf0646e6f4fe
MD5 8da18a07fa607545c8eec2ad1aa302ad
BLAKE2b-256 a21716f043b540fb8a224da255c47d081f1f639435d94bac6b211cc8291ca10e

See more details on using hashes here.

Provenance

The following attestation bundles were made for robotframework_pydantic-0.1.0.tar.gz:

Publisher: publish.yml on DudeNr33/robotframework-pydantic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file robotframework_pydantic-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_pydantic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11458246bd73bea5595c6e488f347ce52906841e8c0ed625fca2d247c29f5bbb
MD5 77aaaf9518227a388b1342292803d4e5
BLAKE2b-256 dd848fc500b672b9833a4aebb5cc7c547bb4ebdb2665ad7badb198dd0516e3ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for robotframework_pydantic-0.1.0-py3-none-any.whl:

Publisher: publish.yml on DudeNr33/robotframework-pydantic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page