Skip to content

package for simple interaction with the Kaggle API for brane data pipelines.

License

Notifications You must be signed in to change notification settings

romnn/kaggle-brane

Repository files navigation

Kaggle for brane

This brane package provides wrappers for the Kaggle API for easy interaction when working with data pipelines and machine learning models in brane.

Prerequisites

In order to use the Kaggle’s public API, you must authenticate using an API token. From the site header, click on your user profile picture, then on “My Account” from the dropdown menu. This will take you to your account settings at https://www.kaggle.com/account. Scroll down to the section of the page labelled API. To create a new token, click on the “Create New API Token” button. This will download a fresh authentication token onto your machine.

Furthermore, if you attempt to interact with a specific competition (e.g. download it or submit), you must enter the challenge and accept the rules via the kaggle website with the same account you use with the API first!

Usage

First, import the brain package from this repository:

brane import romnn/kaggle-brane

You also need to push the package to be able to import it in your remote session or jupyterlab notebook:

brane push kaggle 1.0.0

Subsequently, the kaggle package can be imported in your brane scripts to interact with kaggle. You can try it out with the brane --debug repl as well:

import kaggle;
let test := download_competition("comp-name", "./data", "kaggle_username", "kaggle_key", false, true);

Documentation

At the moment, only download_competition is considered production ready, but more API calls have been implemented to cover the full Kaggle API for an easy integration with your brane projects.

The easiest way to learn about the available functions, parameters and return types, is to explore the package with

brane --debug test kaggle

after you imported it.

This will give you a list of all the available functions and show you the parameters in the order they are expected. When you supply valid credentials and the desired parameters you will be able so see the output of the function.

Local development

It is recommended to develop locally by using environment variables and the run.py python script. This will use the Kaggle API with your local kaggle credentials at ~/.kaggle/kaggle.json if available

COMPETITION=web-traffic-time-series-forecasting DESTINATION=. ./run.py competitions download

Build the brane package

After local development, you can build and push the brane package with the included Makefile command:

make build

# check that the package was updated and test it
brane list
brane --debug test kaggle

About

package for simple interaction with the Kaggle API for brane data pipelines.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published