Snowfakery is a Python tool for generating fake data models with relational integrity. It allows users to define complex data structures, including relationships between 'tables' (objects), using YAML configuration. Each generated record is unique and random. Currently at version 4.2.1, it maintains an active development pace with frequent minor releases and occasional major updates addressing Python compatibility and core feature enhancements.
pip install snowfakeryVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically use Snowfakery to generate JSON data based on a YAML data model. It uses `io.StringIO` to avoid creating temporary files, making it suitable for in-memory execution.
Upgrade your Python environment to version 3.11 or later. Alternatively, stick to Snowfakery versions < 4.0.0 if you must use an older Python version (e.g., `pip install 'snowfakery<4'`).
Ensure your formulas explicitly return the desired type if you rely on specific non-string outputs. For compatibility with older behaviors, remove `snowfakery_version: 3` from your YAML or adjust formulas to explicitly cast to strings if needed.
Always refer to the official Snowfakery documentation for correct YAML syntax. Use an IDE with YAML linting, and consider using the provided JSON Schema for validation if available (`snowfakery --json-schema`).
Only use Salesforce-specific features when integrated with a Salesforce project and CumulusCI, or ensure your environment is configured with the necessary Salesforce connection details.
Upgrade your Python environment to 3.11 or newer, or install an older version of Snowfakery: `pip install 'snowfakery<4'`.
Carefully review your Snowfakery YAML definition for syntax errors. Pay close attention to indentation and ensure all keys are correctly terminated with colons. Use a YAML linter.
Ensure that any custom generators or functions are correctly defined and passed to `generate_data` using the `extra_functions` or `extra_generators` parameters if used programmatically, or defined in an included file if using the CLI.