General đī¸ Quick-Start GuidesQuick-Start: Python Get started with Kaiko Stream and Python
Using Kaiko Stream with Python is simple.
Before we start, let's create a new folder on your machine, and save these files to it. Once you've done this, follow the checklist below.
This file contains important PIP information for your Python script to run.
This file contains additional PIP information for your Python script to run.
This file contains the minimum requirements for the script to run.
This tells Python what to do in the instance you lose connection with Kaiko Stream.
Checklist
Get your API key - You'll need and active subscription and your API Key from the Kaiko team before you can start receiving any data from Kaiko Stream. If you don't have it, ask support@kaiko.com.
Download Python - You must have a minimum of Python 3.9 installed on your device. If you don't have it already, download it and install it here .
Open your command-line interfaces - Terminal on Mac, Command Prompt on Windows, or any interface of your preference.
Create a Python file - Create a Python file on your machine and save to the folder where you saved everything else.
Install pip - If you don't have it already, see the get-pip-py
method here .
Install pipenv - If you don't already have pipenv, install it by typing the command pip install pipenv
or $ brew install pipenv
. If this is unsuccessful, there are alternative methods here . Note: we recommend pipenv
over pip
for enhanced reliability. If you are using other tools like conda, virtualenv or venv, please refer to this documentation to see migration paths or your own tool documentation.
Pick your Kaiko product - Choose your Kaiko product you'd like to use from the menu on the left-hand-side.
Copy the code example - Navigate to the Python code example on the page and copy the code. Paste this into your new Python file.
Configure your parameters - Configure your parameters in the parameters section of the template and save the file.
Open your interpreter - Go back to your command-line interface and navigate to the directory you just saved your files. Typing ls
on Mac or dir
on windows will show your current directory, to then open one of the files, type cd filename
.
Run pipenv and start a new shell - First, run the pipenv isntall
command. Next, run pipenv shell
Run your script - Add your API key and run the script you just configured by typing KAIKO_API_KEY=<your_key> Python3 kaikoendpoints.py
.... and that's it! You'll now receive updates in real-time as per your configuration.
This guide is intended to get you started with Stream and Python. You can also access our full SDK here , where you'll find more coding languages, examples and guidance.
Last updated 4 months ago