Skip to main content

A powerful CLI tool for generating realistic mock data with relationships and referential integrity

Project description

Mockingbird 🐦

Generate realistic mock data with relationships in seconds

PyPI version Python Support License: MIT

Mockingbird is a powerful CLI tool that generates realistic mock data with proper relationships and referential integrity. Perfect for testing, development, demos, and populating databases with meaningful data.

✨ Key Features

  • 🎯 Realistic Data: Generate names, emails, addresses, and more using the Faker library
  • 🔗 Relational Integrity: Create proper foreign key relationships between entities
  • 📝 Simple Configuration: Define your data structure in an intuitive YAML blueprint
  • 🎲 Reproducible: Use seeds to generate the same dataset consistently
  • 📊 Multiple Formats: Output to CSV, JSON, or Parquet
  • ⚡ Fast Generation: Efficiently create large datasets
  • 🏗️ Complex Relationships: Support for multi-level references and contextual data

🚀 Quick Start

Installation

pip install mockingbird

Create Your First Dataset

  1. Initialize a blueprint:

    mockingbird init
    
  2. Define your data structure in Blueprint.yaml:

    Users:
      count: 100
      fields:
        user_id: {generator: sequence, config: {start_at: 1}}
        name: {generator: faker, config: {generator: name}}
        email: {generator: faker, config: {generator: email}}
        status: {generator: choice, config: {choices: ["active", "inactive"], weights: [0.8, 0.2]}}
    
    Orders:
      count: 250
      fields:
        order_id: {generator: sequence, config: {start_at: 1000}}
        user_id: {generator: ref, config: {ref: Users.user_id}}
        order_date: {generator: faker, config: {generator: date_time_this_year}}
        amount: {generator: faker, config: {generator: pydecimal, left_digits: 3, right_digits: 2, positive: true}}
    
  3. Generate your data:

    mockingbird generate
    
  4. Find your data in the output_data/ directory as CSV files!

🎯 Use Cases

  • 🧪 Testing: Create realistic test datasets for your applications
  • 🔧 Development: Populate development databases with meaningful data
  • 📊 Demos: Generate impressive demo data for presentations
  • ⚡ Performance Testing: Create large datasets to test system performance
  • 🎓 Learning: Practice with realistic data for tutorials and courses

🛠️ Generators

Mockingbird provides powerful generators for different data types:

Generator Purpose Example
sequence Auto-incrementing numbers User IDs, Order numbers
faker Realistic fake data Names, emails, addresses
choice Random selection from options Status, categories, types
ref Reference other entities Foreign keys, relationships
timestamp Random dates/times Creation dates, events
expr Custom expressions Calculated fields, conditions
enum Cycle through values Round-robin assignments

📖 Examples

E-commerce Dataset

Categories:
  count: 5
  fields:
    category_id: {generator: sequence, config: {start_at: 100}}
    name: {generator: choice, config: {choices: ["Electronics", "Books", "Clothing", "Home", "Sports"]}}

Products:
  count: 50
  fields:
    product_id: {generator: sequence, config: {start_at: 200}}
    name: {generator: faker, config: {generator: catch_phrase}}
    category_id: {generator: ref, config: {ref: Categories.category_id}}
    price: {generator: faker, config: {generator: pydecimal, left_digits: 3, right_digits: 2, positive: true}}

Customers:
  count: 25
  fields:
    customer_id: {generator: sequence, config: {start_at: 1000}}
    name: {generator: faker, config: {generator: name}}
    email: {generator: faker, config: {generator: email}}

Orders:
  count: 75
  fields:
    order_id: {generator: sequence, config: {start_at: 3000}}
    customer_id: {generator: ref, config: {ref: Customers.customer_id}}
    customer_name: {generator: ref, config: {use_record_from: customer_id, field_to_get: name}}
    order_date: {generator: faker, config: {generator: date_time_this_year}}

OrderItems:
  count: 200
  fields:
    item_id: {generator: sequence, config: {start_at: 4000}}
    order_id: {generator: ref, config: {ref: Orders.order_id}}
    product_id: {generator: ref, config: {ref: Products.product_id}}
    quantity: {generator: faker, config: {generator: random_int, min: 1, max: 4}}
    unit_price: {generator: ref, config: {use_record_from: product_id, field_to_get: price}}

User Activity Tracking

Users:
  count: 50
  fields:
    user_id: {generator: sequence}
    username: {generator: faker, config: {generator: user_name}}
    email: {generator: faker, config: {generator: email}}

Events:
  count: 500
  fields:
    event_id: {generator: sequence, config: {start_at: 10000}}
    user_id: {generator: ref, config: {ref: Users.user_id}}
    event_type: {generator: choice, config: {choices: ["login", "logout", "view_page", "purchase"]}}
    timestamp: {generator: timestamp, config: {start_date: "2024-01-01", end_date: "2024-12-31"}}

🎛️ Command Line Options

# Basic generation
mockingbird generate

# Custom blueprint and output
mockingbird generate --blueprint my_data.yaml --output-dir ./data --format parquet

# Reproducible data with seed
mockingbird generate --seed 42

# Different output formats
mockingbird generate --format json
mockingbird generate --format parquet

📋 Requirements

  • Python 3.11 or higher
  • No additional dependencies required

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Report Issues: Found a bug? Open an issue
  2. Feature Requests: Have an idea? We'd love to hear it!
  3. Code Contributions: Submit pull requests for bug fixes or new features
  4. Documentation: Help improve our docs and examples

Development Setup

git clone https://github.com/your-org/mockingbird.git
cd mockingbird
pip install -e .

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

🎉 Why Mockingbird?

Unlike other mock data generators, Mockingbird focuses on relationships and realism:

  • Smart References: Automatic dependency resolution ensures data integrity
  • Contextual Data: Pull related fields from the same record for consistency
  • Realistic Distributions: Use weights to create realistic data patterns
  • Scalable: Generate thousands of related records efficiently
  • Flexible Output: Choose the format that works for your workflow

Ready to generate some amazing mock data? 🚀

pip install mockingbird-cli
mockingbird init
mockingbird generate

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

mockingbird_cli-0.1.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

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

mockingbird_cli-0.1.0-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mockingbird_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for mockingbird_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9580a0aa433a02359e7c0250659d1876224c7c28275c58a4b8f084ed6b7e1a19
MD5 7963af11943044c1fa74e8014839717c
BLAKE2b-256 50b17b1c2972359b60c809b0f9612aa11e1eba57fa1c735232e32aeb901f9d22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mockingbird_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78273ad376dd2cbf4aaab9d5a3d5599ea88832e56f60579209653aef4579dff3
MD5 ab80efe6ee22f8a5140e4ce699202f98
BLAKE2b-256 0c9fca58fa87cff1259e2b75e46377e3dc950115ed7d225bdf606dc360e9c80e

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