DEV Community

Derrick Sherrill for WayScript

Posted on

Programmatically Write CSV Files using Pandas, Python, and WayScript


Working with WayScript helps you automate simple tasks while you can focus on the important work.

Today, we’ll learn to use Python to programmatically write CSV files with pandas.


No prerequisites but some content you might find helpful:

Time Trigger

To make the script running, we’ll simply use a Time Trigger.

Add it as a Trigger and choose whatever time suits you best.

Adding the Trigger


WayScript provides a Requests module to easily make requests without having to write a single line of code. Add it as a new step.

Adding the module

We’ll make requests to Star Wars API. We’ll fetch all the planets of the Star Wars Universe using this endpoint.

Configuring the module

Once it’s done we can write the Python Script to write the JSON data into a CSV file.


WayScript also provides a Python module to execute python scripts in our workflow. Add it as a new step.

Adding the Python module

Once it’s added, we can write the script.

Writing the script

If you run the script, you’ll notice a new file in the project directory. Well, it’s our CSV file.

File in the directory

Well, here’s the content.

Content of the CSV file


Questions about this script or anything else? Join our Discord. We're always around to help. If you want to work with the full script template, just find it here.

Top comments (0)