63 lines
1.5 KiB
Markdown
63 lines
1.5 KiB
Markdown
## [kaggle_manager](../../scripts/kaggle_manager)
|
|
|
|
Manages Kaggle datasets and notebooks via the Kaggle API.
|
|
|
|
## Description
|
|
|
|
This script provides command-line access to Kaggle functionality including:
|
|
- Downloading datasets
|
|
- Fetching notebooks
|
|
- Submitting competition entries
|
|
|
|
## Prerequisites
|
|
|
|
You must have a `kaggle.json` file at `~/.kaggle/kaggle.json` containing your Kaggle credentials:
|
|
```json
|
|
{
|
|
"username": "your_username",
|
|
"key": "your_api_key"
|
|
}
|
|
```
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
./kaggle_manager.sh [options]
|
|
```
|
|
|
|
## Options
|
|
|
|
- `-d, --dataset <name>`: Download a dataset (format: `username/dataset-name`)
|
|
- `-n, --notebook <name>`: Download a notebook (format: `username/notebook-name`)
|
|
- `-s, --submit <file>`: Submit a notebook file to a competition
|
|
- `-c, --competition <name>`: Specify competition name for submission
|
|
- `-g, --git`: Add and commit changes to Git after operation
|
|
- `-v, --verbose`: Enable verbose output
|
|
- `-h, --help`: Display help message
|
|
|
|
## Examples
|
|
|
|
```bash
|
|
# Download a dataset
|
|
./kaggle_manager.sh -d "zillow/zecon"
|
|
|
|
# Download a notebook
|
|
./kaggle_manager.sh -n "jfraeys/my-notebook"
|
|
|
|
# Submit to competition
|
|
./kaggle_manager.sh -s submission.csv -c "titanic"
|
|
|
|
# Download with Git commit
|
|
./kaggle_manager.sh -d "zillow/zecon" -g
|
|
```
|
|
|
|
## Directory Structure
|
|
|
|
- Datasets: Stored in `data/raw/`
|
|
- Notebooks: Stored in `notebooks/`
|
|
|
|
## Notes
|
|
|
|
- The script uses curl to interact with the Kaggle API
|
|
- Credentials are extracted from kaggle.json using jq
|
|
- Git commits use the message: "Added dataset or notebook"
|