Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Overview

Download the Files

There are two key files for running this test

  • Bulk_Download.py

  • Config.ini

Get Your API Key

Follow the steps listed here to download the API Key for your account.

https://esharesearch.atlassian.net/wiki/spaces/GGA/pages/3293282331/Getting+Started+with+the+Trustwell+Genesis+Foods+GraphQL+API#Obtaining-your-API-Key

We will need to save this API Key in the configuration file in the next step.

Update the Configuration Files

What to change?

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

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 bulk_download.py

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

Running the Export - Windows Instructions

  • No labels