Tutorial | Dataiku public API#
The Dataiku APIs give coders the flexibility to complete both routine and complex tasks with code instead of the visual interface. Let’s take a brief tour of the public API in particular!
Get started#
The use case for this project is simple: run a scenario to print a message informing us whose birthday is today. However, rather than relying on the visual interface, you’ll be using the public API to execute this and a number of other tasks.
Objectives#
In this tutorial, you will:
See the difference between the HTTP REST API and the Python client to the public API.
Using the Python client library, programmatically interact with Dataiku objects such as projects, datasets, variables, Flows, jobs, and scenarios.
Prerequisites#
To complete this tutorial, you will need:
Dataiku 12.0 or later.
An Advanced Analytics Designer or Full Designer user profile.
A Python environment that includes the packages requests and datetime.
This tutorial was tested using a Python 3.6 code environment, but other Python versions may also be compatible.
You can find instructions for creating a code environment compatible with all courses in the Developer learning path in this how-to.
Create the project#
From the Dataiku Design homepage, click + New Project.
Select Learning projects.
Search for and select APIs in Dataiku.
Click Install.
From the project homepage, click Go to Flow (or
g
+f
).
From the Dataiku Design homepage, click + New Project.
Select DSS tutorials.
Filter by Developer.
Select APIs in Dataiku.
From the project homepage, click Go to Flow (or
g
+f
).
Note
You can also download the starter project from this website and import it as a zip file.
Use case summary#
The starting Flow of this project is very simple.
The birthdates dataset contains records of names and birth dates.
The Prepare recipe extracts the components of the birth dates (day, month, year).
The Filter recipe filters the dataset for the current date.
We could manually build this Flow, but instead, we are going to use the public API to automate this task. When you have completed the tutorial, you will have built the Flow pictured below and much more (all without touching the visual tools):
Open the notebook#
Unlike most Academy tutorials, most of the instructions for this tutorial are self-contained in a pre-existing Python notebook.
Navigate to the Notebooks page (
g
+n
).Open the notebook Tutorial Instructions, and begin running the cells one at a time.
Note
Depending on the kernels available to your instance, you may need to select a new kernel, inside the notebook. This tutorial was tested using a Python 3.6 code environment, but other Python versions may also be compatible.
What’s next?#
Congratulations on taking your first steps exploring the capabilities of the public API.
Now that you have the basics, the best place to learn more is to consult the Developer Guide, including the sections on concepts and examples and the Python API reference.