Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
stylenone

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.

export_to_csv.py

Download export_to_csv.py here

Screen Shot 2024-11-20 at 11.37.14 AM.png

config.ini

Download config.ini here

Info

On Windows, you may need to force a download as the browser will potentially warn about downloading this file.

Take note of what directory you’ve downloaded those files to - that will be important in subsequent steps.

...

1

Change to the directory you downloaded the file. For MacOS, this will most likely be the Downloads directory.

cd ~/Downloads

Screen Shot 2024-11-20 at 1.13.35 PM.png

2

Run the command python export_to_csv.py (depending on whether your executable was python or python3).

Screen Shot 2024-11-20 at 4.19.48 PM.pngImage Added

Info

If you receive an error that looks like ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2r  26 Feb 2019' then you will need to issue two additional commands to continue the setup process (just once)

pip uninstall urllib3

pip install 'urllib3<2.0'

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

Change to the directory you downloaded the 'export_to_csv.py' file above. For Windows, this will most likely be the Downloads directory.

cd Downloads

Screen Shot 2024-11-20 at 3.11.00 PM.png

2

Run the command python export_to_csv.py

Screen Shot 2024-11-20 at 3.11.55 PM.png

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.

Next Steps

...

.