Skip to main content

AnAPI for Nepali stock data from ShareSansar for NEPSE Market

Project description

ShareSansar API 📈

Python Version License GitHub stars

An API for Nepali stock market data For NEPSE Market.

✨ Features

  • 🐍 Familiar API for Python developers
  • 📊 Historical data - Get stock data for any date range
  • 🔢 Multiple symbols - Download data for multiple stocks at once
  • 📅 Flexible date ranges - Support for various period formats
  • Easy to use - Simple, intuitive API design
  • 🇳🇵 Nepali stocks - Focused on Nepal Stock Exchange (NEPSE)

📦 Notes

  • More Section will be added soon in new updates

📦 Installation

pip install sharesansar-api

# Usage Guide

This file provides instructions and examples for using the `sharesansar-api` library.

---

## 1. Installation

First, install the package using pip:

```bash
pip install sharesansar-api

2. 🚀 Quick Start

Here are the most common commands to get you started immediately.

import sharesansar as ss

# Single stock (yfinance style)
nabil = ss.Ticker("NABIL")
info = nabil.info()
history = nabil.history(period="1w")

# Multiple stocks
data = ss.download(["NABIL", "SCB", "NICA"], period="1m")

# Market data for specific date
market_data = ss.get_market_data("2024-12-20")

3. 📚 Usage Examples

Detailed examples for specific use cases.

Get Stock Information

import sharesansar as ss

ticker = ss.Ticker("NABIL")
info = ticker.info()

print(f"LTP: {info['ltp']}")
print(f"Change: {info['change']} ({info['change_percent']}%)")

Historical Data

import sharesansar as ss

# Various period formats
data_1w = ss.Ticker("SCB").history(period="1w")
data_1m = ss.Ticker("NICA").history(period="1m")
data_custom = ss.Ticker("KBL").history(start="2024-01-01", end="2024-12-31")

Multiple Stocks

import sharesansar as ss

# Download multiple stocks
symbols = ["NABIL", "SCB", "NICA", "NMB", "KBL"]
data = ss.download(symbols, period="1w")

Market Overview

import sharesansar as ss

# Get all available symbols
symbols = ss.get_available_symbols()
print(f"Total stocks: {len(symbols)}")

# Get complete market data for the latest day
market_data = ss.get_market_data()

4. 🛠️ API Reference

A quick reference for available classes and functions.

Ticker Class

  • Ticker(symbol): Create a stock ticker object.
  • ticker.info(): Get current stock information.
  • ticker.history(period, start, end): Get historical data.

Module Functions

  • download(symbols, period): Download multiple stocks.
  • history(symbol, start, end): Get historical data for a single stock.
  • get_stock_info(symbol): Get detailed stock info.
  • get_market_data(date): Get market-wide data (latest if date is omitted).
  • get_available_symbols(): List all stock symbols.

Period Options

Valid strings for the period parameter:

  • "1d" - One day
  • "1w" - One week
  • "1m" - One month
  • "3m" - Three months
  • "6m" - Six months
  • "1y" - One year
  • "ytd" - Year to date

5. 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

6. 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


7. 🙏 Acknowledgments

  • ShareSansar.com for providing the data.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sharesansar_api-0.3.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sharesansar_api-0.3.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file sharesansar_api-0.3.0.tar.gz.

File metadata

  • Download URL: sharesansar_api-0.3.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for sharesansar_api-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9a1bfc41903f4eea1de6fdf0728925725c800a904011164d46b07a35679f5b1b
MD5 36ea33e3899d356f4c543bf07f11c92c
BLAKE2b-256 a714f6ecc7a937b1b853a9e4b0f32d523dffaa1dedaa9b72f4dc3e0b71df2484

See more details on using hashes here.

File details

Details for the file sharesansar_api-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sharesansar_api-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5451b2bf03faef86292d3a749e1abdadb9aa1b05cb7dd0119b0c0ce2b600ee7
MD5 ba7e31ebc74803f8ee9acf3140a39cca
BLAKE2b-256 f316910e319af8f07e95b49e4463a6e62931dff1c10cee75cbd1c5d5adbad0f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page