People & Culture
Added Jul 15, 2020

Vortexa’s Python SDK for a Programming Novice

Share this article
  1. Mentors on my team who I could turn to when I was having an issue — Vortexa’s data scientists and engineers were more than willing to take time out of their day to help me build a complex query.
  2. Practice. The more queries I did the easier it became.

In the office raising money for Movember with two of my mentors Tino von Stegmann (left) and Kit Burgess (middle)

Getting Started

In the SDK documentation, there is a setup FAQ section, found here. It covers everything you need to know to get started using the SDK on your machine; including where to request a demo.

Importing Modules and Libraries

At the start of the notebook, we have to import the libraries and modules which we are going to be using. In this notebook, we use three of the Vortexa SDK’s endpoints, the DateTime library, Pandas and Matplotlib. To use them in the notebook, we have to import them like this:

from vortexasdk import Products, CargoTimeSeries, Geographies
from datetime import datetime
import pandas as pd
import matplotlib.pyplot as plt
Products Endpoint Tutorial

First I’m going to show you how to get the Vortexa ID for a product you are interested in studying from the products endpoint. Whilst there are many ways of doing this, I will show you just one example that I believed was the best option. In the documentation for the products endpoint, we can see an example line of code which shows us how to look in for different products in a list.

df = Products().search(term=[‘diesel’, ‘fuel oil’, ‘grane’]).to_df()
crude_search_df = Products().search(term=[‘crude’]).to_df()
crude_search_df.query(“name==’Crude/Condensates’”)
pd.set_option(‘max_colwidth’, 75)
CargoTimeSeries Endpoint Tutorial

First, let’s look at the example in the documentation:

Screenshot 2020-07-15 at 17.21.04CargoTimeSeries endpoint example from the SDK documentation
Screenshot 2020-07-15 at 17.21.24CargoTimeSeries endpoint example query changed to return floating storage in China
Exporting your data as a CSV

If you would like to export the final DataFrame as a CSV, use the following :

df_fs.to_csv(‘~/Desktop/chinese_floating_storage.csv’)
Final Thoughts

Today we’ve learned how to take example code from Vortexa’s Python SDK documentation and change it to fit a real-world example. This is a skill you can translate to any Python package. If you would like to look into more examples for the Vortexa SDK you can find all of the documentation here.

The latest news

Jan 13, 2022
Company News
blog-events
name
Listing_Summary-Vortexa_July2019

Today, Vortexa is proud to launch the world’s most complete data and analytics for global onshore crude inventories, enabling commodities traders and analysts to gain the fastest and most accurate view of global supply and demand balances.

subscribe_insight-form
blog-tag
location
banner_bg
getintouch-section
post_body
Dec 10, 2021
People & Culture
blog-events
name
Listing_Summary-Vortexa_July2019

Ever wondered what a day in the life looks like at Vortexa for a Data Engineer? We sat down with Arthur Degonde to dig deeper into what energises him most about working at Vortexa, what he really thinks of the company culture and what qualities are needed to succeed...

subscribe_insight-form
blog-tag
location
banner_bg
getintouch-section
post_body
Dec 1, 2021
People & Culture
blog-events
name
Listing_Summary-Vortexa_July2019

In celebration of Movember, Vortexa raised over £6,000 in donations towards increasing awareness of men's physical and mental health problems. We sat down with some of our 'Motexans' to understand why this movement is so critically important to them and why discussing difficulties needs to be destigmatised.

subscribe_insight-form
blog-tag
location
banner_bg
getintouch-section
post_body
module_156214284821327

Get in touch today for a free trial