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.
- 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.
Before running the script, ensure you have the following installed:
- Git
- Python 3.8 or newer
- Docker (optional)
- The Kaggle CLI (pip install kaggle)
- Clone the Repository: Clone this repository to your local machine using git clone .
- Place Your Kaggle API Key: Ensure your kaggle.json file (containing your Kaggle API credentials) is in the same directory as the setup script.
- 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
- Docker Usage: After running the script, use the following command to work with your project in a Docker container:
Adjust the port mappings and volume as needed for your project.
Copy code docker run -it --rm -p 8888:8888 -v "$PWD/my_kaggle_project":/home/cq kaggle_project_image
- 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.
- 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.
- Contributions to this script are welcome. Please fork the repository, make your changes, and submit a pull request.
- 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.