Add external Python dependencies

How to add external Python dependencies to transformer function in GlassFlow.

GlassFlow supports including any external Python libraries in your transformation function. This allows you to easily manage and integrate additional Python packages needed for your data transformations.

Warning:

You should not include built-in Python libraries like math or random in your requirements.txt file. These are a part of Python and aren't installed separately.

Include Python dependencies using WebApp

1

Access the WebApp

  • Navigate to your existing or new GlassFlow pipeline in the WebApp.
  • Go to the "Transformer" tab and select "requirement.txt" file.
2

Edit requirements.txt

  • You will see an editor where you can modify the requirements.txt file.
  • Add the names of the libraries you need, one per line. For example:
  • Alternatively, if you needed to specify certain versions, another valid example would be:
3

Save Changes

  • After editing, click the "Save Transformer" button to apply your changes.
  • The WebApp will automatically install the specified libraries in your pipeline project environment.

Include Python dependencies using SDK

1

Prepare the requirements file

Create a requirements.txt file in your project directory. List all the dependencies your transformation script (transform.py) needs.

2

Create the pipeline with dependencies

Pass the requirements.txt file as an argument to the create_pipeline function using the requirements parameter.

Here’s how it looks in code:

Once the pipeline is created, GlassFlow will automatically install the listed dependencies in the environment where your transformation functions will run.