Coder Social home page Coder Social logo

sp1thas / airflow-provider-kaggle Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 47 KB

Airflow operators and hooks for interacting with the Kaggle API

License: Apache License 2.0

Python 100.00%
airflow airflow-hook airflow-operators airflow-providers kaggle

airflow-provider-kaggle's Introduction

Airflow Kaggle

Airflow Kaggle Provider

Airflow operators and hooks for interacting with the Kaggle API

Mypy checked Code style: Black pre-commit enabled Apache Airflow version

Overview

This airflow provider allows you to interact with the Kaggle API using the corresponding CLI tool. This provider is implemented in an abstract way in order to provide the maximum backward and forward compatibility, as a result, using this provider you can run any command supported by the kaggle-api.

Installation

Pre-requisites: An environment running apache-airflow >= 2.0

pip install airflow-provider-kaggle

Configuration

In order to use this airflow-provider, you have to create a kaggle connection:

  • Conn ID: kaggle_default
  • Conn Type: Kaggle
  • Extra: <kaggle.json>

NOTE: More details on how to get your Kaggle credentials are available here

Usage

Operators

kaggle_provider.operators.kaggle.KaggleOperator

This is the main operator that can be used to execute any kaggle cli command:

from kaggle_provider.operators.kaggle import KaggleOperator

list_competitions_op = KaggleOperator(task_id='foo', command='competitions_list', op_kwargs={'sort_by': 'prize'})

Hooks

kaggle_provider.hooks.kaggle.KaggleHook

This is the kaggle hook which is used by the operator and can also be used directly in your custom operator too.

from kaggle_provider.hooks.kaggle import KaggleHook

hook = KaggleHook()
hook.run('datasets_list', sort_by="votes", user="sp1thas")

Available commands

  • competitions_list
  • competition_submit
  • competition_submissions
  • competition_list_files
  • competition_download_file
  • competition_download_files
  • competition_leaderboard_download
  • competition_leaderboard_view
  • dataset_list
  • dataset_metadata_prep
  • dataset_metadata_update
  • dataset_metadata
  • dataset_list_files
  • dataset_status
  • dataset_download_file
  • dataset_download_files
  • dataset_create_version
  • dataset_initialize
  • dataset_create_new
  • download_file
  • kernels_list
  • kernels_initialize
  • kernels_push
  • kernels_pull
  • kernels_output
  • kernels_status
  • model_get
  • model_list
  • model_initialize
  • model_create_new
  • model_delete
  • model_update
  • model_instance_get
  • model_instance_initialize
  • model_instance_create
  • model_instance_delete
  • model_instance_update
  • model_instance_version_create
  • model_instance_version_download
  • model_instance_version_delete
  • download_needed

Details regarding the command arguments can be found in the corresponding method docstring of this module

airflow-provider-kaggle's People

Contributors

sp1thas avatar

Watchers

 avatar  avatar

airflow-provider-kaggle's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.