Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Update the Configuration Files

What to change?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 4 keys

Setting

Value

endpoint

For production use cases, use https://api.trustwell.com/genesis

For working against the preview environment, use https://api-preview.trustwell.com/genesis

api_key

The API key you obtained from Genesis Foods in the section above.

output_csv

The name of the CSV file you’d like to save the results to. Defaults to genesis_recipes.csv

limit

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, will default to 10000.

MacOS Instructions

One-Time System Setup

Python is already installed by default on MacOS, so we just need to install a few plugins to help the script work.

You only need to do this once, regardless of how often you plan to use the export process.

1

Open the Terminal application. You can do this from your dock or through Spotlight search by clicking on command+spacebar.

Screen Shot 2024-11-19 at 5.21.13 PM.png

2

Let’s next check the command to launch Python, as it may vary depending on your OS version. Issue the commands

which python

which python3

to see which Python executable we have installed. In the example on the right, our Python executable is python3 as indicated by the response.

Screen Shot 2024-11-19 at 5.26.02 PM.png

3

Similarly, we’ll need to check the path for pip - which is the package installer for Python. Issue the commands

which pip

which pip3

to see which pip executable is available. In the example on the right, both pip and pip3 are available (they are likely the same, but that’s an advanced topic).

Screen Shot 2024-11-19 at 5.27.42 PM.png

4

Now we need to download a plugin - issue the command

pip install requests or pip3 install requests (depending on the executable that was available in Step 3) to install the requests package.

Screen Shot 2024-11-19 at 5.37.41 PM.png

We’re now ready to run the export script! You only need to do this once, regardless of how often you plan to use the export process.

Running the Export Script

1

Change to the directory you downloaded the file

2

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

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 we 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.

...