psxdata-feed

By (author)Qazi Asim Kamal

Tech stack:
JS
PY
HTML
CSS

This repo showcases the use of the psxdata Python package to extract stock market information for companies listed on the Pakistan Stock Exchange. You...
read more
AI Contributions:1
Published At:October 20, 2026
Files Included:15 file(s)
Updated At:October 22, 2026

Read Me

PSX Dashboard

A small dashboard that lists selected Pakistan Stock Exchange companies as cards. Backend: FastAPI on top of the psxdata package. Frontend: React (Vite).

Each card shows a ticker monogram icon, company name, sector, price, day change, a 30-day sparkline, market cap, P/E, dividend yield, 1-year change, volume, 30-day average volume, day range and KSE-100 index weight.

How psxdata is used

Card datapsxdata call
Price, sector, market cap, P/E, dividend yield, 1Y change, avg volumepsxdata.screener()
Company namepsxdata.symbols()
Sparkline, day change, day range, volumepsxdata.stocks(symbol, start, end)
KSE-100 weightpsxdata.indices("KSE100")

psxdata caches on disk (~/.psxdata/cache), so the screener is fetched once per 15 minutes no matter how many cards you show. The API adds a 5-minute in-memory cache per card.

Run it

Requires Python 3.11+ and Node 18+.

# 1. Backend (terminal 1)
cd backend
pip install -r requirements.txt
uvicorn app.main:app --port 8000

# 2. Frontend (terminal 2)
cd frontend
npm install
npm run dev          # http://localhost:5173  (proxies /api to :8000)

No network access to PSX (or want to try the UI offline)? Start the backend with demo data:

PSX_MOCK=1 uvicorn app.main:app --port 8000      # Windows PowerShell: $env:PSX_MOCK=1

The UI then shows a Demo data badge instead of Live PSX data.

API

EndpointDescription
GET /api/healthStatus and data source (live or mock)
GET /api/watchlistDefault tickers
GET /api/stocks?symbols=ENGRO,LUCKCard data; omit symbols for the default list (max 30)
GET /api/stocks/{symbol}/history?days=90Daily OHLCV bars

Interactive docs at http://localhost:8000/docs.

Configuration

  • CORS_ORIGINS - comma-separated allowed origins (default: the Vite dev server).
  • API_URL - where the Vite dev proxy forwards /api (default http://127.0.0.1:8000).
  • Edit DEFAULT_WATCHLIST in backend/app/main.py to change the default companies. In the browser, tickers can be added or removed and are remembered in local storage.

Tests

cd backend && python -m pytest

Notes

  • psxdata is alpha software and scrapes PSX's public pages, so columns or availability can change.
  • Prices are informational only, not investment advice.

Loading

Loading

Loading

More like this View all

Supabase Login and Signup System with MFA

A fully completed system integrated with Supabase Authentication along with authenticator app and basic interface fully work. Set environment variables for MFA system controls and Supabae API config.

  • 0

    Ratings

  • 27

    Files

    • PY
    • HTML
    • +4

    Tech stack

readme-gap-finder

Most teams have no idea how long it actually takes a new developer to become productive, or which parts of the codebase confuse them the most. I'll fix that. Using nothing but your git commit history

  • 0

    Ratings

  • 1

    Files

    • PY
    • HTML
    • +4

    Tech stack

Deep-web-academic-search

Deep-web-academic-search

  • 0

    Ratings

  • 16

    Files

    • JS
    • HTML
    • +2

    Tech stack