EDA

Repo for all contributed Snowfakery recipes, maintained by Data Gen Toolkit team.

Snowfakery Sample for Education Data Architecture (EDA)

These instructions explain how to create sample data using for EDA objects using the sample files in the snowfakery_samples directory.

Install Snowfakery

  1. Install Python. Python is usually pre-installed on MacOS. See CumulusCI installation instructions for installing on Windows

  2. Install pipx

    pip3 install pipx
    
    # add pipx to your path and restart your terminal if necessary
    
  3. Install snowfakery

    pipx install snowfakery
       
    # test the installation
    snowfakery --version
    
  4. Generate sample data locally. Run Snowfakery with the eda_objects.yml file to generate output on your local machine.

    snowfakery snowfakery_samples/EDA/eda_objects.yml
    

Note that the eda_objects.yml recipe is dependent on the eda_macros.yml file in the same directory. Be sure to copy both and save in the same directory if copying to a new project.

Generate Data in a Salesforce Org

To load snowfakery data into a Salesforce org, you also need to install the Salesforce CLI and CumulusCI and connect to a Salesforce Dev Hub org. Follow this Trailhead module to get set up.

Generate Data in a Scratch Org

  1. Navigate to the root folder of the project that is organized with source format.

  2. Initialize CumulusCI configuration in the project

    cci project init
    

    Make sure you enter sfdx for the source format and indicate that you are extending EDA as part of the setup wizard.

  3. Add a snowfakery recipe to the datasets directory

  4. Create a new scratch org with EDA installed using CumulusCI
    cci flow run dev_org --org dev
    
  5. Assign account record types to Admin profile The sample recipe in this repo creates account records using record types that are common in a unversity context. The admin profile does not have access to these record types by default in the scratch org. Navigate to the System Admininistrator profile and assign all of the Account object record types to the profile.

  6. Load the sample data from the snowfakery recipe
    # example below assumes the snowfakery recipe is located datasets/eda_objects.yml
    cci task run generate_and_load_from_yaml -o generator_yaml datasets/eda_objects.yml --org dev
    
  7. Open the scratch org and view data
    cci org browser dev
    

Generate Data in a Sandbox

  1. Navigate to the project folder

  2. Initialize CumulusCI configuration in the project

    cci project init
    
  3. Add a snowfakery recipe to the datasets directory

  4. Connect CumulusCI to the sandbox environment
    cci org connect <sandbox_name> --sandbox
    
  5. Load the sample data from the snowfakery recipe
    # example below assumes the snowfakery recipe is located datasets/eda_objects.yml
    cci task run generate_and_load_from_yaml -o generator_yaml datasets/eda_objects.yml --org <sandbox_name>
    
  6. Open the sandbox org and view data
    cci org browser <sandbox_name>
    

Resources