Skip to content

feat: support for Kaggle Notebooks #400

Open
@filipchristiansen

Description

@filipchristiansen

Support for Kaggle Notebooks

Invocation

  • CLI: gitingest https://www.kaggle.com/code/USER-NAME/NOTEBOOK-NAME
  • PyPI package: ingest("https://www.kaggle.com/code/USER-NAME/NOTEBOOK-NAME")

Implementation

  • Detect the kaggle.com/code/ host and route to a Kaggle downloader.

  • Wrap the Kaggle CLI command:

    kaggle kernels get --path PATH USER-NAME/NOTEBOOK-NAME

Private Kaggle Notebooks

Follow the Kaggle API instructions to create a Kaggle API token.

Options

  1. Save the kaggle.json file containing the token in the default path (~/.kaggle/kaggle.json or C:\Users\<username>\.kaggle\kaggle.json).

  2. Export the username and token as environment variables:

    export KAGGLE_USERNAME=USER-NAME
    export KAGGLE_KEY=TOKEN
  3. Specify the token per run

    • PyPI package: token="TOKEN" (in ingest / ingest_async)

    • CLI: --token TOKEN

    • Web UI: tick Private Repository and paste the token in the Private Access Token field.

    Note: Option 3 temporarily overrides any local KAGGLE_USERNAME / KAGGLE_KEY environment variables.

    Update: Kaggle CLI requires KAGGLE_USERNAME + KAGGLE_KEY even for public notebooks. Therefore, option 3 would require to allow the user to, in some way, enter their username.

Notebook outputs

  • Cell outputs are never downloaded by the Kaggle API.

References

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions