Webinar: Why logical layers matter, and how to use them -Watch now

Mode's Python Notebooks now support the Requests library

Image of author
Angeline Char, Product Marketing

November 21, 2017

2 minute read

Mode is the only analytics platform with native support for Python Notebooks. For the last year and a half, Mode users have been rapidly adopting our Notebooks, and that trend shows no sign of slowing down.

Since Mode's Python Notebooks are automatically connected to a database, you don't have to leave your analytics workflow to use Python. Having SQL and Python on one platform lets analysts seamlessly access the power and flexibility of Python's diverse libraries.

Today, we're making our Python Notebooks even more powerful by adding support for the Requests library. (For a full list of the Python libraries available in Mode, see here.)

With Requests, you can make HTTP requests and pull data into your Notebooks from anywhere on the internet.

Requests lets you enrich your datasets with a huge variety of external information—basically any freely available dataset on the internet is now at your fingertips and can be easily added to your Notebooks.

To give you a taste for what's possible with Requests, we built out a simple example. We started with some lat and long data that we pulled from a SQL query and then added to our Notebook. Then, we called the OpenCage Geocoder API and enriched our dataset with new fields for city, country, state and formatted_address.

The output cell now contains this more complete geodata, which you can easily include in a report. And anyone with a Mode login can see a Python-powered Notebook or report.

There's more to come

We're hard at work expanding functionality for our Python Notebooks, including a secure way to call sites requiring API credentials from the Notebook. This is coming soon, so stay tuned! For now, please note that we discourage accessing APIs that require authentication using personally identifiable credentials and information, as they may be exposed when you share your notebooks.

Dive back into the editor to take Requests for a spin. Or, if you're looking for inspiration, you can read about putting Python to work for analytics on our blog. If you'd like to add Python to your arsenal, check out our tutorial.

Questions? Feedback? take a look at our help docs, send us a note at hi@modeanalytics.com, or start a chat in the product.

Get our weekly data newsletter

Work-related distractions for data enthusiasts.