sharesansar-api


Namesharesansar-api JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/Paul-hembrom/sharesansar-api
SummaryAnAPI for Nepali stock data from ShareSansar for NEPSE Market
upload_time2025-10-27 09:03:17
maintainerNone
docs_urlNone
authorPaul Hembrom
requires_python>=3.7
licenseNone
keywords nepal stocks sharesansar finance trading
VCS
bugtrack_url
requirements requests pandas beautifulsoup4 lxml
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ShareSansar API 📈

![Python Version](https://img.shields.io/badge/python-3.7%2B-blue)
![License](https://img.shields.io/badge/license-MIT-green)
![GitHub stars](https://img.shields.io/github/stars/Paul-hembrom/sharesansar-api?style=social)

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

```bash
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.

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

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

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

```python
import sharesansar as ss

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

### Market Overview

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Paul-hembrom/sharesansar-api",
    "name": "sharesansar-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "nepal, stocks, sharesansar, finance, trading",
    "author": "Paul Hembrom",
    "author_email": "Paul Hembrom <hembrompaulus192@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a7/14/f6ecc7a937b1b853a9e4b0f32d523dffaa1dedaa9b72f4dc3e0b71df2484/sharesansar_api-0.3.0.tar.gz",
    "platform": null,
    "description": "# ShareSansar API \ud83d\udcc8\r\n\r\n![Python Version](https://img.shields.io/badge/python-3.7%2B-blue)\r\n![License](https://img.shields.io/badge/license-MIT-green)\r\n![GitHub stars](https://img.shields.io/github/stars/Paul-hembrom/sharesansar-api?style=social)\r\n\r\nAn API for Nepali stock market data For NEPSE Market.\r\n\r\n## \u2728 Features\r\n\r\n- \ud83d\udc0d  Familiar API for Python developers\r\n- \ud83d\udcca **Historical data** - Get stock data for any date range\r\n- \ud83d\udd22 **Multiple symbols** - Download data for multiple stocks at once\r\n- \ud83d\udcc5 **Flexible date ranges** - Support for various period formats\r\n-  **Easy to use** - Simple, intuitive API design\r\n- \ud83c\uddf3\ud83c\uddf5 **Nepali stocks** - Focused on Nepal Stock Exchange (NEPSE)\r\n\r\n## \ud83d\udce6 Notes\r\n- More Section will be added soon in new updates\r\n## \ud83d\udce6 Installation\r\n\r\n```bash\r\npip install sharesansar-api\r\n\r\n# Usage Guide\r\n\r\nThis file provides instructions and examples for using the `sharesansar-api` library.\r\n\r\n---\r\n\r\n## 1. Installation\r\n\r\nFirst, install the package using pip:\r\n\r\n```bash\r\npip install sharesansar-api\r\n```\r\n\r\n---\r\n\r\n## 2. \ud83d\ude80 Quick Start\r\n\r\nHere are the most common commands to get you started immediately.\r\n\r\n```python\r\nimport sharesansar as ss\r\n\r\n# Single stock (yfinance style)\r\nnabil = ss.Ticker(\"NABIL\")\r\ninfo = nabil.info()\r\nhistory = nabil.history(period=\"1w\")\r\n\r\n# Multiple stocks\r\ndata = ss.download([\"NABIL\", \"SCB\", \"NICA\"], period=\"1m\")\r\n\r\n# Market data for specific date\r\nmarket_data = ss.get_market_data(\"2024-12-20\")\r\n```\r\n\r\n---\r\n\r\n## 3. \ud83d\udcda Usage Examples\r\n\r\nDetailed examples for specific use cases.\r\n\r\n### Get Stock Information\r\n\r\n```python\r\nimport sharesansar as ss\r\n\r\nticker = ss.Ticker(\"NABIL\")\r\ninfo = ticker.info()\r\n\r\nprint(f\"LTP: {info['ltp']}\")\r\nprint(f\"Change: {info['change']} ({info['change_percent']}%)\")\r\n```\r\n\r\n### Historical Data\r\n\r\n```python\r\nimport sharesansar as ss\r\n\r\n# Various period formats\r\ndata_1w = ss.Ticker(\"SCB\").history(period=\"1w\")\r\ndata_1m = ss.Ticker(\"NICA\").history(period=\"1m\")\r\ndata_custom = ss.Ticker(\"KBL\").history(start=\"2024-01-01\", end=\"2024-12-31\")\r\n```\r\n\r\n### Multiple Stocks\r\n\r\n```python\r\nimport sharesansar as ss\r\n\r\n# Download multiple stocks\r\nsymbols = [\"NABIL\", \"SCB\", \"NICA\", \"NMB\", \"KBL\"]\r\ndata = ss.download(symbols, period=\"1w\")\r\n```\r\n\r\n### Market Overview\r\n\r\n```python\r\nimport sharesansar as ss\r\n\r\n# Get all available symbols\r\nsymbols = ss.get_available_symbols()\r\nprint(f\"Total stocks: {len(symbols)}\")\r\n\r\n# Get complete market data for the latest day\r\nmarket_data = ss.get_market_data()\r\n```\r\n\r\n---\r\n\r\n## 4. \ud83d\udee0\ufe0f API Reference\r\n\r\nA quick reference for available classes and functions.\r\n\r\n### `Ticker` Class\r\n\r\n-   **`Ticker(symbol)`**: Create a stock ticker object.\r\n-   **`ticker.info()`**: Get current stock information.\r\n-   **`ticker.history(period, start, end)`**: Get historical data.\r\n\r\n### Module Functions\r\n\r\n-   **`download(symbols, period)`**: Download multiple stocks.\r\n-   **`history(symbol, start, end)`**: Get historical data for a single stock.\r\n-   **`get_stock_info(symbol)`**: Get detailed stock info.\r\n-   **`get_market_data(date)`**: Get market-wide data (latest if `date` is omitted).\r\n-   **`get_available_symbols()`**: List all stock symbols.\r\n\r\n### Period Options\r\n\r\nValid strings for the `period` parameter:\r\n\r\n-   `\"1d\"` - One day\r\n-   `\"1w\"` - One week\r\n-   `\"1m\"` - One month\r\n-   `\"3m\"` - Three months\r\n-   `\"6m\"` - Six months\r\n-   `\"1y\"` - One year\r\n-   `\"ytd\"` - Year to date\r\n\r\n---\r\n\r\n## 5. \ud83e\udd1d Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n1.  Fork the project\r\n2.  Create your feature branch (`git checkout -b feature/AmazingFeature`)\r\n3.  Commit your changes (`git commit -m 'Add some AmazingFeature'`)\r\n4.  Push to the branch (`git push origin feature/AmazingFeature`)\r\n5.  Open a Pull Request\r\n\r\n---\r\n\r\n## 6. \ud83d\udcc4 License\r\n\r\nThis project is licensed under the MIT License - see the `LICENSE` file for details.\r\n\r\n---\r\n\r\n## 7. \ud83d\ude4f Acknowledgments\r\n\r\n-   ShareSansar.com for providing the data.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "AnAPI for Nepali stock data from ShareSansar for NEPSE Market",
    "version": "0.3.0",
    "project_urls": {
        "Bug Reports": "https://github.com/Paul-hembrom/sharesansar-api/issues",
        "Homepage": "https://github.com/Paul-hembrom/sharesansar-api"
    },
    "split_keywords": [
        "nepal",
        " stocks",
        " sharesansar",
        " finance",
        " trading"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f316910e319af8f07e95b49e4463a6e62931dff1c10cee75cbd1c5d5adbad0f7",
                "md5": "ba7e31ebc74803f8ee9acf3140a39cca",
                "sha256": "f5451b2bf03faef86292d3a749e1abdadb9aa1b05cb7dd0119b0c0ce2b600ee7"
            },
            "downloads": -1,
            "filename": "sharesansar_api-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ba7e31ebc74803f8ee9acf3140a39cca",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 9743,
            "upload_time": "2025-10-27T09:03:16",
            "upload_time_iso_8601": "2025-10-27T09:03:16.662188Z",
            "url": "https://files.pythonhosted.org/packages/f3/16/910e319af8f07e95b49e4463a6e62931dff1c10cee75cbd1c5d5adbad0f7/sharesansar_api-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a714f6ecc7a937b1b853a9e4b0f32d523dffaa1dedaa9b72f4dc3e0b71df2484",
                "md5": "36ea33e3899d356f4c543bf07f11c92c",
                "sha256": "9a1bfc41903f4eea1de6fdf0728925725c800a904011164d46b07a35679f5b1b"
            },
            "downloads": -1,
            "filename": "sharesansar_api-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "36ea33e3899d356f4c543bf07f11c92c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11213,
            "upload_time": "2025-10-27T09:03:17",
            "upload_time_iso_8601": "2025-10-27T09:03:17.959759Z",
            "url": "https://files.pythonhosted.org/packages/a7/14/f6ecc7a937b1b853a9e4b0f32d523dffaa1dedaa9b72f4dc3e0b71df2484/sharesansar_api-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-27 09:03:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Paul-hembrom",
    "github_project": "sharesansar-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.25.0"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    ">=",
                    "1.3.0"
                ]
            ]
        },
        {
            "name": "beautifulsoup4",
            "specs": [
                [
                    ">=",
                    "4.9.0"
                ]
            ]
        },
        {
            "name": "lxml",
            "specs": [
                [
                    ">=",
                    "4.6.0"
                ]
            ]
        }
    ],
    "lcname": "sharesansar-api"
}
        
Elapsed time: 0.69660s