Skip to content
Back to skills

Colab Unzip Workflow

ASecurity

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.

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
toolspythongoapi

Works with

  • claude code
  • api

Security analysis

A100/100

Scanned February 10, 2026

npx -y skills add majiayu000/claude-skill-registry --skill colab-unzip-workflow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Colab Unzip Workflow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Colab Unzip Workflow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-colab-unzip-workflow/badge)](https://www.skillsdirectory.com/skills/majiayu000-colab-unzip-workflow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: colab-unzip-workflow
description: "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."
author: Claude Code
date: 2024-12-28
---

# 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

```python
# 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 |
|---------|---------------|----------------|
| `API_KEYS_FILE = None` | No keys loaded, yfinance used | Always set explicit path |
| `/content/drive/MyDrive/API_key.txt` | File not on Drive after unzip | Unzip goes to /content/, not Drive |
| `API_key.txt` (relative) | Wrong working directory in Colab | Use absolute paths |
| `API_key.txt` (wrong name) | File is `API_key_500Paper.txt` | 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

```python
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

1. **After unzip: `/content/Alpaca_trading/`** - not Drive
2. **Check actual filenames** - don't assume `API_key.txt`
3. **Use absolute paths** - relative paths break in Colab
4. **Verify before assuming** - `os.path.exists()` is your friend

## Files Modified

```
notebooks/training.ipynb:
  - Cell 15: API_KEYS_FILE = '/content/Alpaca_trading/API_key_500Paper.txt'
```

## References
- Skill: `data-source-priority` - Why Alpaca API matters
- `alpaca_trading/data/fetcher.py` - Key loading logic with logging

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.