Generate realistic synthetic seed data for a HOL lab app. Reads the app's models and creates 20-50 records per entity with industry-authentic values, realistic relationships, and useful edge cases.
You are generating realistic seed data for a HOL lab app. The data should feel authentic to the company's domain — not obviously fake placeholder data.
The user has provided a domain description via $ARGUMENTS. This may be a company profile, industry description, or file path.
Read models.py and schemas.py to understand:
Plan the data before generating it:
Mix in a few records that exercise boundary conditions:
These edge cases help participants discover planted bugs more naturally.
Rewrite seed.py with the full dataset. The file should:
"""Seed the database with synthetic data for the {App Name} HOL lab."""
from database import SessionLocal, init_db, engine, Base
from models import ModelA, ModelB, ModelC
from datetime import date, datetime
def seed():
# Drop and recreate tables for clean state
Base.metadata.drop_all(bind=engine)
init_db()
db = SessionLocal()
try:
# Create reference/lookup data first
# ...
# Create primary entities
# ...
# Create secondary entities
# ...
# Create transaction/junction records
# ...
db.commit()
print(f"Seeded: X records of A, Y records of B, Z records of C")
finally:
db.close()
if __name__ == "__main__":
seed()
ModelA(field1="value", field2=123)db.add_all([...])uv run python seed.py # Should complete without errors
uv run pytest # All tests should still pass
uv run uvicorn main:app --reload # Quick check that data is served
Test a few API endpoints to confirm data is visible and relationships work.
Summarize the dataset: