Skip to content
$ pip install pythonql

An integrated query language for Python.

Web demo

Welcome to the PythonQL web demo

The demo is organized into a number of scenarios that show the power and usability of PythonQL. Each scenario illustrates a specific use case in data science that is addressed by the language.

01

Customer Journey

Collecting the full information about a customer journey through your services, and then analyzing the business from those journeys, is a powerful way to improve customer experience. A customer journey is a list of heterogeneous events with timestamps, so running analytics on it is challenging. Modeling the journeys as a table and using SQL does not quite work, and neither do typical data analysis frameworks. PythonQL handles this because it combines queries over nested data with the analytics that data science needs.

02

Data Integration and Cleaning

Even though data is supposed to be clean and of top quality in the 21st century, that is not always the case. Cleaning and integrating dirty data is a common problem that falls onto data scientists, and it is especially painful when you need a quick assessment of a data source or want to know whether integrating it would be worth the trouble. Here we have a customer database and an order database we are considering integrating. The order data is questionable, and our task is to find out quickly whether it is useful to us.

03

Model Evaluation

Getting the first results from your models is exciting, but a lot of time will be spent analyzing model performance and improving the results. Basic measures like AUC or MRSE are easy to calculate, but what happens when you need to compare two models qualitatively and figure out which cases are better covered by each model? The ad hoc analytical abilities of PythonQL come to the rescue. Here we are not querying a database, we are querying the results of our machine learning models.

04

Nested and Semi Structured Data

In this scenario we query JSON data that comes from a NoSQL database, join it to more structured relational data, and then construct nested JSON objects that use hierarchy to organize data. We have a JSON product catalog of cars with reviews, where the manufacturer, price and review fields can each be a plain value or a nested object, plus a small relational dataset with dealer information.

Running the demo

Install PythonQL and run the queries locally

Each query on this site is shown in full. To execute a query against the demo data, install the PythonQL package and run the scenario in your own Python environment.

$ pip install pythonql

Python 3 users install pythonql3 instead. Package pages and the tutorial live on the project repositories:

Background reading

Where the language comes from

PythonQL borrows deliberately from established query languages and libraries. These references explain the ideas behind the syntax.