Claude-skill-registry colab-unzip-workflow
Colab file paths after unzipping repo. Trigger when: (1) API key file not found, (2) file path errors in Colab, (3) configuring notebook paths, (4) 'yfinance fallback' despite keys existing.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/colab-unzip-workflow" ~/.claude/skills/majiayu000-claude-skill-registry-colab-unzip-workflow && rm -rf "$T"
manifest:
skills/data/colab-unzip-workflow/SKILL.mdsource content
Colab Unzip Workflow - File Paths
Critical Information
When you unzip Alpaca_trading.zip in Colab, the files are at:
/content/Alpaca_trading/
NOT on Google Drive. NOT at
/content/drive/MyDrive/.
API Key Files in This Repo
The repo contains these API key files:
/content/Alpaca_trading/API_key_500Paper.txt # 500 paper account /content/Alpaca_trading/API_key_100kPaper.txt # 100k paper account
NOT
API_key.txt. The files have specific names.
Correct Default in training.ipynb
# Cell 15 - CORRECT API_KEYS_FILE = '/content/Alpaca_trading/API_key_500Paper.txt' # WRONG - file doesn't exist at this path API_KEYS_FILE = '/content/drive/MyDrive/API_key.txt' # WRONG - file name is wrong API_KEYS_FILE = '/content/Alpaca_trading/API_key.txt'
Failed Attempts (Critical)
| Attempt | Why it Failed | Lesson Learned |
|---|---|---|
| No keys loaded, yfinance used | Always set explicit path |
| File not on Drive after unzip | Unzip goes to /content/, not Drive |
(relative) | Wrong working directory in Colab | Use absolute paths |
(wrong name) | File is | Check actual filenames in repo |
Colab Directory Structure After Unzip
/content/ ├── Alpaca_trading/ # Unzipped repo │ ├── API_key_500Paper.txt # API keys (500 paper) │ ├── API_key_100kPaper.txt # API keys (100k paper) │ ├── notebooks/ │ │ └── training.ipynb │ ├── alpaca_trading/ │ │ └── ... │ └── ... ├── drive/ # Google Drive (if mounted) │ └── MyDrive/ │ └── ... # User's Drive files └── sample_data/ # Colab default
How to Verify in Colab
import os # Check what's in /content/ print(os.listdir('/content/')) # Should show: ['Alpaca_trading', 'drive', 'sample_data'] # Check API key files print(os.listdir('/content/Alpaca_trading/')) # Should show: API_key_500Paper.txt, API_key_100kPaper.txt, etc. # Verify file exists api_path = '/content/Alpaca_trading/API_key_500Paper.txt' print(f"File exists: {os.path.exists(api_path)}")
Key Rules
- After unzip:
- not Drive/content/Alpaca_trading/ - Check actual filenames - don't assume
API_key.txt - Use absolute paths - relative paths break in Colab
- Verify before assuming -
is your friendos.path.exists()
Files Modified
notebooks/training.ipynb: - Cell 15: API_KEYS_FILE = '/content/Alpaca_trading/API_key_500Paper.txt'
References
- Skill:
- Why Alpaca API mattersdata-source-priority
- Key loading logic with loggingalpaca_trading/data/fetcher.py