Skip to content

BhanuprakashAvadutha/basket-csv-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

basket-csv-generator

Vercel Next.js

Research note → broker-ready basket CSV in 10 seconds using Claude API.

Problem solved: Building 21-column broker CSVs by hand from research notes took 4–5 min per basket, with a non-zero error rate. Wrong CE/PE → real-money mistake. Wrong date format → upload fails.

Live demo: basket-csv-generator.vercel.app

How it works

Research note (plain text)
        │
        ▼
Claude API (structured extraction)
        │
        ▼ Pydantic/Zod validation
        │
        ▼
21-column broker CSV (Zerodha/Upstox/AngelOne format)
        │
        ▼
Direct upload to broker basket

Example

Input:

Buy 100 shares of Reliance at market. Also buy 1 lot of Nifty 21000 CE 
December expiry at 85. Both CNC. Stop loss Nifty option at 40.

Output (basket.csv):

tradingsymbol,exchange,transaction_type,order_type,quantity,price,trigger_price,...
RELIANCE,NSE,BUY,MARKET,100,0,0,...
NIFTY24DEC21000CE,NFO,BUY,LIMIT,50,85,0,...
NIFTY24DEC21000CE,NFO,SELL,SL,50,40,40,...

API

curl -X POST https://basket-csv-generator.vercel.app/api/generate \
  -H "Content-Type: application/json" \
  -d '{
    "research_note": "Buy 100 Reliance at market CNC",
    "broker": "zerodha",
    "product_type": "CNC"
  }' \
  --output basket.csv

Local development

git clone https://github.com/BhanuprakashAvadutha/basket-csv-generator.git
cd basket-csv-generator
npm install
cp .env.example .env.local
# Add ANTHROPIC_API_KEY to .env.local
npm run dev

Supported brokers

Broker CSV Format Status
Zerodha 21-column Kite format
Upstox Upstox basket format 🚧
AngelOne SmartAPI format 🚧

Tech stack

  • Next.js 15 (App Router)
  • Anthropic Claude API (claude-sonnet-4) — structured extraction
  • Zod — runtime validation of extracted orders
  • Vercel — deployment

License

MIT

About

Research note to broker-ready 21-column basket CSV in 10 seconds via Claude API. Next.js 15 + Zod validation. Zero upload errors since deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages