Skip to content

Shubhamnpk/yonepse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

389 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

YONEPSE - Real-time NEPSE Stock Dashboard

YONEPSE Favicon

YONEPSE License

A modern, elegant, and comprehensive dashboard as well as open api for tracking live stock prices from the Nepal Stock Exchange (NEPSE). Features real-time market data, sector filtering, IPO tracking, broker directory, and automated data updates via GitHub Actions.


πŸš€ Features

Market Dashboard

  • Live Market Data: Real-time stock prices, changes, and volumes
  • Sector Filtering: Filter stocks by sectors (Hydro, Banking, Insurance, etc.)
  • Instant Search: Search by stock symbol or company name
  • Market Indices: Live NEPSE indices with animated marquee
  • Top Movers: Real-time top gainers and losers
  • Stock Detail Modal: Click any stock for detailed information

IPO Tracking

  • Upcoming IPOs: Track open, upcoming, and closed IPOs
  • Nepali Date Support: Automatic BS to AD date conversion
  • Status Badges: Visual indicators for Open/Upcoming/Closed IPOs
  • Reserved Shares: Special indicators for NRN/reserved share issues

Data Hub

  • Broker Directory: Complete broker listings with filters
  • Membership Types: Filter by broker membership category
  • District/Province Filters: Geographic broker search
  • TMS Links: Direct access to broker trading platforms
  • Market History: Historical market summary data

JSON API

All data is available as static JSON endpoints for developers. See JSON Docs for complete API reference. The OpenAPI spec is available at openapi.yaml.


πŸ–ΌοΈ Live Demo

Visit the dashboard at: https://shubhamnpk.github.io/nepse-scaper/ or


πŸ› οΈ Tech Stack

  • Frontend: HTML5, Vanilla CSS (Glassmorphism Design), Vanilla JavaScript
  • Styling: CSS Variables, Gradient Backgrounds, Backdrop Filters
  • Fonts: Google Fonts (Inter, Outfit)
  • Icons: Font Awesome 6.4.0
  • Backend/Scraper: Python 3.9 (NEPSE API + BeautifulSoup fallback)
  • Automation: GitHub Actions (Scheduled Cron Jobs)
  • Data Sources:

πŸ“ Project Structure

nepse-scraper/
β”œβ”€β”€ index.html                    # Main market dashboard
β”œβ”€β”€ data.html                     # Brokers & datasets page
β”œβ”€β”€ docs.html                     # JSON API documentation
β”œβ”€β”€ script.js                     # Main dashboard logic
β”œβ”€β”€ data.js                       # Data hub logic
β”œβ”€β”€ style.css                     # All styling (glassmorphism)
β”œβ”€β”€ start_server.bat              # Windows local server starter
β”œβ”€β”€ favicon.png                   # Site favicon
β”œβ”€β”€ data/                         # JSON data files
β”‚   β”œβ”€β”€ nepse_data.json             # Stock prices
β”‚   β”œβ”€β”€ indices.json              # Market indices
β”‚   β”œβ”€β”€ sector_indices.json       # Sector indices
β”‚   β”œβ”€β”€ top_stocks.json           # Top gainers/losers
β”‚   β”œβ”€β”€ market_summary.json       # Current market summary
β”‚   β”œβ”€β”€ market_summary_history.json
β”‚   β”œβ”€β”€ market_status.json        # Market open/closed status
β”‚   β”œβ”€β”€ notices.json              # Exchange notices
β”‚   β”œβ”€β”€ disclosures.json          # Company disclosures
β”‚   β”œβ”€β”€ exchange_messages.json    # Exchange announcements
β”‚   β”œβ”€β”€ brokers.json              # Broker directory
β”‚   β”œβ”€β”€ all_securities.json       # Securities metadata
β”‚   β”œβ”€β”€ supply_demand.json        # Supply/demand data
β”‚   β”œβ”€β”€ upcoming_ipo.json         # Upcoming IPOs
β”‚   β”œβ”€β”€ oldipo.json               # IPO archive
β”‚   β”œβ”€β”€ proposed_dividend/        # Proposed dividend datasets
β”‚   β”‚   β”œβ”€β”€ latest_1y.json        # Latest proposed dividends (rolling 1 year)
β”‚   β”‚   β”œβ”€β”€ history_all_years.json # Append-only all-years proposed dividend history
β”‚   β”‚   └── meta.json             # Proposed dividend scraper metadata
β”‚   └── nepse_sector_wise_codes.json
β”œβ”€β”€ scripts/nepse-scraper/
β”‚   β”œβ”€β”€ official_scraper.py       # Main NEPSE API scraper
β”‚   β”œβ”€β”€ upcoming_ipo_scraper.py   # IPO scraper
β”‚   β”œβ”€β”€ proposed_dividend_scraper.py # Proposed dividend scraper
β”‚   β”œβ”€β”€ scraper.py                # Backup web scraper
β”‚   β”œβ”€β”€ requirements.txt          # Python dependencies
β”‚   └── official_api/             # NEPSE API client
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ auth.py                 # Authentication
β”‚       β”œβ”€β”€ client.py               # API client
β”‚       β”œβ”€β”€ core.py                 # Core functionality
β”‚       β”œβ”€β”€ endpoints.py            # API endpoints
β”‚       β”œβ”€β”€ exceptions.py           # Custom exceptions
β”‚       └── nepse.wasm              # WebAssembly for auth
└── .github/workflows/
    β”œβ”€β”€ scrape.yml                  # Market data automation
    └── scrape_ipo.yml            # IPO data automation

πŸ“¦ Installation & Usage

1. Fork & Setup (GitHub Pages)

  1. Fork this repository
  2. Enable GitHub Actions in the 'Actions' tab
  3. Enable GitHub Pages from Settings > Pages (Deploy from main branch)
  4. Your dashboard will be live at https://shubhamnpk.github.io/nepse-scaper/

2. Run Locally

Option A: Using Batch File (Windows)

start_server.bat

Option B: Using Python

python -m http.server 8000

Then open http://localhost:8000 in your browser.

3. Manual Data Updates

To force a data update locally:

cd scripts/nepse-scraper
pip install -r requirements.txt

# Update all market data
python official_scraper.py

# Update broker and securities (run once per 60 days)
python official_scraper.py --brokers --securities

# Update IPO data
python upcoming_ipo_scraper.py

# Update proposed dividend data (daily mode)
python proposed_dividend_scraper.py --mode latest

# Optional full all-years backfill
python proposed_dividend_scraper.py --mode backfill

πŸ”„ Automation (GitHub Actions)

Market Data Scraper (.github/workflows/scrape.yml)

  • Schedule: Every 30 minutes
  • Time: 10:00 AM - 4:00 PM NPT (Sunday - Friday)
  • Data: Stock prices, indices, market summary, top stocks, notices, disclosures, exchange messages, supply/demand
  • Files: Updates all JSON files in data/ folder
  • Schedule: Daily at 4:00 AM UTC (9:45 AM NPT)
  • Data: Upcoming IPO announcements + proposed dividend refresh
  • Files: data/upcoming_ipo.json, data/oldipo.json, data/proposed_dividend/latest_1y.json, data/proposed_dividend/history_all_years.json, data/proposed_dividend/meta.json
  • Features: Auto-archives IPOs older than 10 days and updates proposed dividend datasets

πŸ“‹ Available JSON Endpoints

All data is accessible as static JSON endpoints:

Endpoint Type Description
/data/nepse_data.json Array Stock prices (symbol, LTP, change, volume)
/data/indices.json Array Main NEPSE indices
/data/sector_indices.json Array Sector-wise indices
/data/top_stocks.json Object Top gainers, losers, turnover
/data/market_summary.json Object Current day market summary
/data/market_summary_history.json Array Historical market data
/data/market_status.json Object Market open/closed status
/data/disclosures.json Array Company disclosures
/data/exchange_messages.json Array Exchange announcements
/data/brokers.json Array Complete broker directory
/data/all_securities.json Array Master list of securities metadata
/data/supply_demand.json Object Supply/demand snapshots
/data/upcoming_ipo.json Array Upcoming IPO listings
/data/oldipo.json Array Historical IPO archive
/data/notices.json Object Exchange & company notices
/data/proposed_dividend/latest_1y.json Array Latest proposed dividends (rolling 1 year)
/data/proposed_dividend/history_all_years.json Array Append-only all-years proposed dividend history
/data/proposed_dividend/meta.json Object Proposed dividend scraper run metadata
/data/nepse_sector_wise_codes.json Object Sector mapping for stocks

See docs.html for complete documentation.


🎨 Design Features

  • Glassmorphism Design: Translucent cards with backdrop blur
  • Dark Theme: Optimized for extended viewing
  • Responsive Layout: Mobile-friendly design
  • Gradient Accents: Purple-to-pink gradient highlights
  • Smooth Animations: Hover effects and transitions
  • Custom Scrollbar: Styled for dark theme
  • Accessibility: ARIA labels, keyboard navigation support

πŸ§‘β€πŸ’» Development

Prerequisites

  • Python 3.9+
  • Modern web browser
  • (Optional) Local server for testing

Key Components

Frontend

  • index.html - Main dashboard with stock cards, search, filters
  • data.html - Broker directory with tables and filters
  • docs.html - API documentation
  • script.js - Dashboard logic, IPO date parsing, Nepali date conversion
  • data.js - Broker filtering, dataset rendering
  • style.css - Complete styling (1685 lines)

Backend


πŸ“± Data Sources

  • NEPSE Official API: Primary source for market data
  • Merolagani: IPO announcements and company news
  • ShareSansar: Backup data source

Data is scraped for educational purposes. All data credits belong to the respective owners.


🀝 Credits

  • Developers: My Wallet Team & Yoguru Team & @Shubhamnpk
  • Data Sources: Nepal Stock Exchange (NEPSE), Merolagani, ShareSansar
  • Not affiliated with: NEPSE, Merolagani, or ShareSansar

πŸ“„ License

This project is open-source and available under the MIT License.


πŸ“ž Support

For issues, feature requests, or contributions, please open an issue on GitHub.


Built with ❀️ for the Nepali investment community

About

A modern, elegant, and comprehensive dashboard as well as open api for tracking live stock prices from the Nepal Stock Exchange (NEPSE). Features real-time market data, sector filtering, IPO tracking, broker directory, and automated data updates via GitHub Actions.

Topics

Resources

License

Stars

Watchers

Forks

Contributors