Skip to content

tommed/ducto-faker

Repository files navigation

A part of Project Ducto

Ducto Faker

CI codecov

Go-powered CLI and library for generating fake/test event data based on structured templates and inline modifiers.


✅ Features

  • CLI and library mode (ducto-faker) for streaming newline-delimited fake records
  • YAML/JSON-based config with template path resolution (relative to config)
  • Mustache-compatible templating with inline modifiers: {{ "field:type:min=1:max=10" }}
  • Supports:
    • Primitive types: int, float, uuid, datetime
    • Enums: status, severity, etc.
    • Faker data: first_name, last_name, phone, address_line1, postcode, country, zip_us
  • Custom types and reusability via top-level custom_types
  • Weighted sampling between multiple templates
  • JSONL output streamed to stdout for easy piping into files or other services
  • 100% unit test coverage, clean Go idioms, fully testable components
  • Fully MIT licensed

🚀 Getting Started

# Install
go install github.com/tommed/ducto-faker/cmd/ducto-faker@latest

# Run from config
ducto-faker -config sample.yaml > output.jsonl

# Pipe into another process
ducto-faker -config sample.yaml | ducto-orchestrator -config orchestrator.yml

🧾 Example Template

{
  "id": {{ "user_id:uuid" }},
  "first_name": {{ "first_name" }},
  "status": {{ "status:enum:values=ACTIVE,INACTIVE" }},
  "score": {{ "score:float:min=0:max=10:dps=2" }},
  "created": {{ "created:datetime:min=2021-01-01T00:00:00Z:max=2022-01-01T00:00:00Z" }}
}

📄 Configuration

total_records: 1000

custom_types:
  status:
    type: enum
    values: 'OPEN,CLOSED,UNKNOWN'

templates:
  - path: templates/login.json.mustache
    weight: 60
  - path: templates/logout.json.mustache
    weight: 40

📚 Documentation


🧑‍💻 Contributing

Pull requests are welcome! Please see our Contributing Guide.


🤖 Related Projects


📜 License

  • MIT licensed — see LICENSE
  • The Ducto name, logos and robot illustrations are © 2025 Tom Medhurst. All rights reserved.

About

Go library and CLI for generating fake/test event data based on templates/sample data using simple mustache syntax and inline modifiers; supports custom types.

Resources

License

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors