Skip to main content

Auto-generate fake data for SQLAlchemy models — zero config

Project description

dbseed

Auto-generate fake data for SQLAlchemy models — zero config


The Problem

Every project needs test data. You either write tedious factory code or install heavy libraries like Faker. For most cases, you just want 100 rows of realistic-looking data.

The Solution

pip install dbseed
from dbseed import seed

users = seed(User, SeedConfig(count=100))
session.add_all(users)
await session.commit()
# Done. 100 users with realistic names, emails, ages.

dbseed inspects your SQLAlchemy model and automatically generates the right kind of data for each column.

Smart Field Detection

Column name contains Generated data
email kzmpqwer@example.com
name Alice Johnson
password, hash Random 64-char string
description, bio Lorem ipsum text
url, link https://example.com/word
phone +12345678901
String type Random alphanumeric
Integer type Random 0-10000
Float type Random 0.0-10000.0
Boolean type Random True/False
DateTime type Random date within last 30 days

Override Specific Fields

from dbseed import seed, SeedConfig

users = seed(User, SeedConfig(
    count=50,
    overrides={
        "role": "admin",                    # static value
        "age": lambda: random.randint(18, 65),  # dynamic callable
    },
))

Features

  • Inspects SQLAlchemy model columns automatically
  • Smart name-based field detection (email, name, url, etc.)
  • Type-based fallback for unknown fields
  • Field overrides (static values or callables)
  • Skips primary keys and server-default columns
  • No external dependencies beyond SQLAlchemy
  • Works with SQLAlchemy 2.0 mapped columns

License

MIT

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

dbseed-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

dbseed-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dbseed-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for dbseed-0.1.0.tar.gz
Algorithm Hash digest
SHA256 48f24b2b42579ed008c8f50c040bab44f98cb5c9f47ee6e318245a8365432bc7
MD5 6779cd5ea6d6b93d822c7339ec5dce96
BLAKE2b-256 96ed093a2f15302d91ef88befb463f92df7ce975a1a5fbe68396e0d98aa80d1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dbseed-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for dbseed-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad24ab583d7f28fac502e49fd07d89fe14bd88cab0929494bb8f35c59073507c
MD5 c8855f24e7106b28fad3fbf834128bfe
BLAKE2b-256 12e28446b4f3a5f70eed87aa5e7382de73180814898f49cb8f5f52c26930e9b1

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