Skip to main content

Library to generate instances of Pydantic models.

Project description

Lorem Pysum

Generate instances of Pydantic models.

License: MIT Code style: black PyPI version Code Coverage

Install

Lorem Pysum is on PyPI and can be installed with:

uv add lorem-pysum

or

pip install lorem-pysum

Usage

Given a Pydantic model type Lorem Pysum can generate instances of that model with randomly generated values.

Example

from enum import auto, Enum
from uuid import UUID

import lorem_pysum
from pydantic import BaseModel


class Flavor(Enum):
    MOCHA = auto()
    VANILLA = auto()


class Brand(BaseModel):
    brand_name: str


class Coffee(BaseModel):
    id: UUID
    description: str
    cream: bool
    sweetener: int
    flavor: Flavor
    brand: Brand


lorem_pysum.generate(Coffee)
# Result -> id=UUID('550342d5-13ce-4ee1-b73d-d3c5e81607ce') description='string' cream=True sweetener=0 flavor=<Flavor.MOCHA: 1> brand=Brand(brand_name='string')

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

lorem_pysum-1.4.12.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

lorem_pysum-1.4.12-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file lorem_pysum-1.4.12.tar.gz.

File metadata

  • Download URL: lorem_pysum-1.4.12.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lorem_pysum-1.4.12.tar.gz
Algorithm Hash digest
SHA256 034c6da492f180571fef110507a83d20549e4250086e49f7d66a124c4e1ccd24
MD5 45ec6fdf65a727242bbecc193ad97ef1
BLAKE2b-256 876a4c415542021803e32a83d746ad89084189311bf38a320520d282b89122e8

See more details on using hashes here.

File details

Details for the file lorem_pysum-1.4.12-py3-none-any.whl.

File metadata

  • Download URL: lorem_pysum-1.4.12-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lorem_pysum-1.4.12-py3-none-any.whl
Algorithm Hash digest
SHA256 8a0ad5ae9102765ada82c38295f36c90398cb7bdb8059de44ee8771433cf3a0b
MD5 7f069dd0edac1e3780a84a82d56b89d8
BLAKE2b-256 9e563944fa1461859ec9f54150662adb7fde45fe87637ea528df701df4e6448d

See more details on using hashes here.

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