Skip to content

This repository contains a Bash script designed to streamline the setup of Kaggle competition environments. It automates the creation of a project directory, setting up a Python virtual environment, installing dependencies, initialising a Git repository, and preparing Docker for Kaggle Python projects.

Notifications You must be signed in to change notification settings

rossop/kaggle-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Kaggle Environment Setup Script

This repository contains a Bash script designed to streamline the setup of Kaggle competition environments. It automates the creation of a project directory, setting up a Python virtual environment, installing dependencies, initializing a Git repository, and preparing Docker for Kaggle Python projects.

Features

  • Project Structure Creation: Automatically generates a directory structure for Kaggle projects.
  • Virtual Environment: Sets up a Python virtual environment and installs necessary libraries from requirements.txt.
  • Git Initialization: Initializes a Git repository and makes the first commit.
  • Docker Integration: Creates a Dockerfile pulling the official Kaggle Python image and sets up your project within a Docker container.
  • Kaggle API Setup: Copies your kaggle.json to the project root for easy access to Kaggle APIs.

Prerequisites

Before running the script, ensure you have the following installed:

  • Git
  • Python 3.8 or newer
  • Docker (optional)
  • The Kaggle CLI (pip install kaggle)

Getting Started

  1. Clone the Repository: Clone this repository to your local machine using git clone .
  2. Place Your Kaggle API Key: Ensure your kaggle.json file (containing your Kaggle API credentials) is in the same directory as the setup script.
  3. Run the Script: Navigate to the repository directory and run the setup script with your desired project name:
    Copy code
    ./setup-kaggle.sh my_kaggle_project
  4. Docker Usage: After running the script, use the following command to work with your project in a Docker container:
    Copy code
    docker run -it --rm -p 8888:8888 -v "$PWD/my_kaggle_project":/home/cq kaggle_project_image
    Adjust the port mappings and volume as needed for your project.

Security Note

  • Kaggle API Key: Your kaggle.json contains sensitive information. The script copies this file to the project directory but ensures it is listed in .gitignore to prevent it from being pushed to any repository.

Customization

  • Requirements File: The script uses requirements.txt for Python dependencies. Modify this file before running the script if you have specific libraries you need installed.
  • Dockerfile: If additional modifications are needed for the Docker environment, you can adjust the Dockerfile generated by the script.

Contribution

  • Contributions to this script are welcome. Please fork the repository, make your changes, and submit a pull request.

License

  • This project is licensed under the MIT License. See the LICENSE file for details.

This README.md provides a clear, step-by-step guide for using your setup script, ensuring that users can quickly get started with Kaggle competitions in a reproducible environment. Adjust the content as necessary to fit the specifics of your script and repository.

About

This repository contains a Bash script designed to streamline the setup of Kaggle competition environments. It automates the creation of a project directory, setting up a Python virtual environment, installing dependencies, initialising a Git repository, and preparing Docker for Kaggle Python projects.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages