Expert agent for Kaggle API authentication, dataset management, and running Kaggle notebooks on Texas Tech HPCC...
This agent specializes in Kaggle API operations, dataset management, and running Kaggle notebooks on Texas Tech HPCC (High Performance Computing Center). The agent understands authentication, dataset creation, competition submissions, and HPCC-specific configurations.
Help users with:
This skill is project-specific and should be stored at:
.cursor/skills/kaggle-api-expert/ (in the spring-2026 project)Automatically apply this skill when users request:
CRITICAL: Before any HPCC operations, always verify VPN connection:
HPCC Access Requirements:
The agent understands:
kaggle.json file format and locationThe agent understands:
The agent understands:
The agent understands:
IMPORTANT: If working with HPCC, verify VPN connection first:
Before proceeding, please confirm:
- Are you connected to the Texas Tech VPN?
- Can you access HPCC resources?
kaggle.json: Save the file (contains username and key)# Install Kaggle API package
pip install kaggle
# Or using conda
conda install -c conda-forge kaggle
Option 1: Credential File (Recommended)
# Create .kaggle directory
mkdir -p ~/.kaggle
# Move kaggle.json to .kaggle directory
mv ~/Downloads/kaggle.json ~/.kaggle/
# Set permissions (required by Kaggle)
chmod 600 ~/.kaggle/kaggle.json
Option 2: Environment Variables
export KAGGLE_USERNAME="your-username"
export KAGGLE_KEY="your-api-key"
Option 3: For HPCC Jupyter
When using Jupyter notebooks on HPCC, credentials should be placed in the home directory:
# On HPCC (after VPN connection)
mkdir -p ~/.kaggle
# Upload kaggle.json to ~/.kaggle/kaggle.json
chmod 600 ~/.kaggle/kaggle.json
kaggle --version
kaggle competitions list
# Create a new dataset
kaggle datasets create -p /path/to/dataset
# With metadata file
kaggle datasets create -p /path/to/dataset -r zip
dataset-directory/
โโโ data.csv
โโโ dataset-metadata.json
โโโ README.md
dataset-metadata.json example:
{
"title": "Dataset Title",
"id": "username/dataset-name",
"licenses": [{"name": "CC0-1.0"}]
}
# Create and upload dataset
kaggle datasets create -p /path/to/dataset -r zip
CRITICAL: Before HPCC operations:
# In Jupyter notebook cell
!pip install kaggle --user
# Verify installation
!kaggle --version
# Option 1: Upload kaggle.json via Jupyter file browser
# Place in ~/.kaggle/kaggle.json
# Option 2: Set environment variables in notebook
import os
os.environ['KAGGLE_USERNAME'] = 'your-username'
os.environ['KAGGLE_KEY'] = 'your-api-key'
# Option 3: Create kaggle.json programmatically (be careful with security)
import json
kaggle_creds = {
"username": "your-username",
"key": "your-api-key"
}
os.makedirs('/home/username/.kaggle', exist_ok=True)
with open('/home/username/.kaggle/kaggle.json', 'w') as f:
json.dump(kaggle_creds, f)
os.chmod('/home/username/.kaggle/kaggle.json', 0o600)
import kaggle
# Download competition dataset
!kaggle competitions download -c competition-name
# Extract files
import zipfile
with zipfile.ZipFile('competition-name.zip', 'r') as zip_ref:
zip_ref.extractall('./data')
# Download dataset
!kaggle datasets download -d username/dataset-name
# Extract
import zipfile
with zipfile.ZipFile('dataset-name.zip', 'r') as zip_ref:
zip_ref.extractall('./data')
# Submit predictions
!kaggle competitions submit -c competition-name -f predictions.csv -m "Submission message"
# Check leaderboard
!kaggle competitions leaderboard competition-name --show
Find Competition: Browse Kaggle Competitions
Download Dataset:
kaggle competitions download -c competition-name
Create Kaggle Notebook:
Write Code:
Submit Predictions:
kaggle competitions submit -c competition-name \
-f predictions.csv \
-m "Model description"
Check Score:
kaggle competitions leaderboard competition-name
HPCC uses environment modules. Load required modules:
# In Jupyter notebook or HPCC terminal
module load python/3.9 # Example version
module load cuda/11.8 # If using GPU
/scratch/username/ for temporary dataHPCC provides:
Symptom: 401 - Unauthorized or 403 - Forbidden
Solutions:
kaggle.json is in ~/.kaggle/chmod 600 ~/.kaggle/kaggle.jsonSymptom: Cannot access HPCC resources
Solutions:
Symptom: Cannot access Jupyter portal
Solutions:
Symptom: kaggle: command not found in Jupyter
Solutions:
# Install with --user flag
!pip install kaggle --user
# Or add to system path
import sys
sys.path.append('/home/username/.local/bin')
Symptom: Permission errors when accessing files
Solutions:
# Fix kaggle.json permissions
chmod 600 ~/.kaggle/kaggle.json
# Fix directory permissions
chmod 700 ~/.kaggle
kaggle.json to version controlchmod 600 for credentialsWhen helping users with Kaggle API and HPCC:
kaggle.json configurationkaggle competitions list to verifyImportant: Always check VPN connection first when working with HPCC resources!