A tool for automatically deploying multi-file Python projects to Kaggle.
Sample: https://www.kaggle.com/datasets/quochungcyou/housing-price-predictor-files https://www.kaggle.com/code/quochungcyou/multi-local-module-project-python-run-sample
This solution automatically converts any multi-file Python project into a Kaggle-compatible format by:
- Analyzing your project structure and dependencies
- Creating a Kaggle dataset containing all your project files
- Generating a Kaggle notebook that automatically downloads and runs your project
- Uploading everything to Kaggle via API
You can try command below to try deploy the sample housing price predictor project:
python kaggle_deploy.py ./housing_price_predictorIf you modify the code and redeploy again, you may need use Check Update option to update the dataset and notebook.
- Install Kaggle API
pip install kaggle-
Configure Kaggle Credentials
- Option A: API Token File
- Go to https://www.kaggle.com/account
- Click "Create New API Token"
- Download kaggle.json
- Place it in:
- Linux/Mac: ~/.kaggle/kaggle.json
- Windows: C:\Users{username}.kaggle\kaggle.json
- Option B: Environment Variables
export KAGGLE_USERNAME="your-username" export KAGGLE_KEY="your-api-key"
- Option A: API Token File
-
Set Permissions (Linux/Mac)
chmod 600 ~/.kaggle/kaggle.json- Download the Deployer Script
git clone https://github.com/yourusername/kaggle-auto-deploy.git
cd kaggle-auto-deploy- Make it Executable (Linux/Mac)
chmod +x kaggle_deployer.py- Optional: Add to PATH (Linux/Mac)
# Add to ~/.bashrc or ~/.zshrc
export PATH="$PATH:/path/to/kaggle_deployer"python kaggle_deployer.py /path/to/your/projectThis repository includes a sample project called housing_price_predictor that demonstrates how to structure a multi-file Python project for deployment to Kaggle.
python kaggle_deploy.py ./housing_price_predictorhousing_price_predictor/
├── main.py # Entry point
├── data_loader.py # Data loading and preprocessing
├── model.py # Model training and evaluation
├── utils/
│ └── helpers.py # Utility functions
├── data/
│ └── housing.csv # Sample data
└── requirements.txt # Dependencies
# Run locally
cd housing_price_predictor
python main.py
# Deploy to Kaggle
python kaggle_deployer.py ./housing_price_predictorMIT


