Table of Contents | ||
---|---|---|
|
Overview
This page outlines the steps necessary to interact with the Genesis Foods API to export a file in CSV format. It utilizes Python, a common computer programming language, to interface with the Genesis Foods API - but users don’t need to know the details in order to work with the API.
Simply follow the instructions below (specifically for MacOS or Windows) to demonstrate how to export recipe information to CSV format.
Download the Files
You will need to download two files - the script that runs the export and a configuration file for the options. These can be downloaded from the Genesis Foods API Example repository (https://github.com/esha/genesis-foods-api-examples ) using the raw download option on the following pages.
| |||
|
|
Take note of what directory you’ve downloaded those files to - that will be important in subsequent steps.
...
The configuration file config.ini
contains settings that will be used in the export process. The list of key settings necessary for this script is found below. There are Use your favorite text editor to open up the file and make changes to the 4 keys below:
Setting | Value |
---|---|
| For production use cases, use For working against the preview environment, use |
| The API key you obtained from Genesis Foods in the section above. |
| The name of the CSV file you’d like to save the results to. Defaults to |
| Limits the number of recipes that will be output to a CSV file. Set this to a lower number for testing purposes. If not present, the script will default to |
...
1 | Change to the directory you downloaded the file. For MacOS, this will most likely be the Downloads directory.
| |
2 | Run the command |
Info |
---|
If you receive an error that looks like
Once this is complete, the script should be able to run to completion. |
You will see the script run, and the CSV file will be exported based on the configuration option you set in the output_csv
variable.
Microsoft Windows Instructions
One-Time System Setup
For Windows, we’ll need to first install Python.
1 | Go to the Microsoft Store and search for Python. There may be multiple versions of Python available; you can select the latest one. | ||
2 | Next, let’s open up the | ||
3 | Now we need to download a plugin - issue the command
To download the plugin we need to run the script. |
We’re now ready to run the export script!
Running the Export
...
Coming soon.
Next Steps
...
Script
1 | Change to the directory you downloaded the '
| |
2 | Run the command |
You will see the script run, and the CSV file will be exported based on the configuration option you set in the output_csv
variable.