niftyfetcher


Nameniftyfetcher JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
Summary📈 A CLI tool to fetch historical OHLC data for stocks using Upstox API
upload_time2025-07-21 09:58:47
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords cli data historical market nifty stock trading upstox
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 📈 NiftyFetcher

A powerful CLI tool to fetch historical OHLC (Open, High, Low, Close) data for stocks using the Upstox API.

## 🚀 Features

- Fetch historical stock data with customizable time intervals
- Support for multiple time units (minute, hour, day, week, month)
- Export data to CSV or Excel formats
- Automatic handling of large date ranges with intelligent chunking
- Clean, user-friendly command-line interface
- Error handling with detailed feedback

## 📦 Installation

Install from PyPI:

```bash
pip install niftyfetcher
```

Or install from source:

```bash
git clone https://github.com/yash2002vardhan/niftyfetcher.git
cd niftyfetcher
pip install -e .
```

## 🛠️ Usage

### Basic Syntax

```bash
niftyfetcher INSTRUMENT_KEY UNIT INTERVAL FROM_DATE TO_DATE FILE_TYPE
```

### Arguments

| Argument | Description | Example Values |
|----------|-------------|----------------|
| `INSTRUMENT_KEY` | Upstox instrument key for the stock | `NSE_EQ\|INE002A01018` |
| `UNIT` | Time unit for data | `minutes`, `hours`, `days`, `weeks`, `months` |
| `INTERVAL` | Interval within the unit | `1`, `5`, `15`, `30` |
| `FROM_DATE` | Start date (YYYY-MM-DD) | `2024-01-01` |
| `TO_DATE` | End date (YYYY-MM-DD) | `2024-01-31` |
| `FILE_TYPE` | Output format | `csv` or `xlsx` |

### 📋 Examples

**Fetch daily data for Nifty 50:**
```bash
niftyfetcher "NSE_INDEX|Nifty 50" days 1 2024-01-01 2024-01-31 csv
```

**Fetch 5-minute interval data:**
```bash
niftyfetcher "NSE_EQ|INE002A01018" minutes 5 2024-01-15 2024-01-16 xlsx
```

**Fetch weekly data for a year:**
```bash
niftyfetcher "NSE_EQ|INE002A01018" weeks 1 2023-01-01 2023-12-31 csv
```

### 📊 Output

The tool generates files with the following naming convention:
```
{instrument_key}_{unit}_{interval}_{from_date}_{to_date}.{file_type}
```

Output contains columns:
- `timestamp` - Date/time of the data point
- `open` - Opening price
- `high` - Highest price
- `low` - Lowest price
- `close` - Closing price

## 🔧 Getting Help

```bash
niftyfetcher --help
```

## 📝 Requirements

- Python 3.8+
- Internet connection for API access

## 🤝 Contributing

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

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ⚠️ Disclaimer

This tool is for educational and research purposes. Always verify data accuracy for trading decisions. The authors are not responsible for any financial losses.

## 🐛 Issues

If you encounter any issues, please report them on [GitHub Issues](https://github.com/yash2002vardhan/niftyfetcher/issues).

## ⚠️ Note on Rate Limits

Please be mindful of the rate limits imposed by the Upstox API to avoid errors or temporary bans. While this tool includes basic safeguards (such as delays between requests), it is ultimately your responsibility to ensure you do not exceed Upstox's allowed request limits. The authors are not liable for any issues arising from rate limit violations.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "niftyfetcher",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "cli, data, historical, market, nifty, stock, trading, upstox",
    "author": null,
    "author_email": "Yashvardhan Goel <yash2002@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/86/2d/3006696497285762a7f2788a996246048988639dfef25c19d91fa0ca2db8/niftyfetcher-0.1.2.tar.gz",
    "platform": null,
    "description": "# \ud83d\udcc8 NiftyFetcher\n\nA powerful CLI tool to fetch historical OHLC (Open, High, Low, Close) data for stocks using the Upstox API.\n\n## \ud83d\ude80 Features\n\n- Fetch historical stock data with customizable time intervals\n- Support for multiple time units (minute, hour, day, week, month)\n- Export data to CSV or Excel formats\n- Automatic handling of large date ranges with intelligent chunking\n- Clean, user-friendly command-line interface\n- Error handling with detailed feedback\n\n## \ud83d\udce6 Installation\n\nInstall from PyPI:\n\n```bash\npip install niftyfetcher\n```\n\nOr install from source:\n\n```bash\ngit clone https://github.com/yash2002vardhan/niftyfetcher.git\ncd niftyfetcher\npip install -e .\n```\n\n## \ud83d\udee0\ufe0f Usage\n\n### Basic Syntax\n\n```bash\nniftyfetcher INSTRUMENT_KEY UNIT INTERVAL FROM_DATE TO_DATE FILE_TYPE\n```\n\n### Arguments\n\n| Argument | Description | Example Values |\n|----------|-------------|----------------|\n| `INSTRUMENT_KEY` | Upstox instrument key for the stock | `NSE_EQ\\|INE002A01018` |\n| `UNIT` | Time unit for data | `minutes`, `hours`, `days`, `weeks`, `months` |\n| `INTERVAL` | Interval within the unit | `1`, `5`, `15`, `30` |\n| `FROM_DATE` | Start date (YYYY-MM-DD) | `2024-01-01` |\n| `TO_DATE` | End date (YYYY-MM-DD) | `2024-01-31` |\n| `FILE_TYPE` | Output format | `csv` or `xlsx` |\n\n### \ud83d\udccb Examples\n\n**Fetch daily data for Nifty 50:**\n```bash\nniftyfetcher \"NSE_INDEX|Nifty 50\" days 1 2024-01-01 2024-01-31 csv\n```\n\n**Fetch 5-minute interval data:**\n```bash\nniftyfetcher \"NSE_EQ|INE002A01018\" minutes 5 2024-01-15 2024-01-16 xlsx\n```\n\n**Fetch weekly data for a year:**\n```bash\nniftyfetcher \"NSE_EQ|INE002A01018\" weeks 1 2023-01-01 2023-12-31 csv\n```\n\n### \ud83d\udcca Output\n\nThe tool generates files with the following naming convention:\n```\n{instrument_key}_{unit}_{interval}_{from_date}_{to_date}.{file_type}\n```\n\nOutput contains columns:\n- `timestamp` - Date/time of the data point\n- `open` - Opening price\n- `high` - Highest price\n- `low` - Lowest price\n- `close` - Closing price\n\n## \ud83d\udd27 Getting Help\n\n```bash\nniftyfetcher --help\n```\n\n## \ud83d\udcdd Requirements\n\n- Python 3.8+\n- Internet connection for API access\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \u26a0\ufe0f Disclaimer\n\nThis tool is for educational and research purposes. Always verify data accuracy for trading decisions. The authors are not responsible for any financial losses.\n\n## \ud83d\udc1b Issues\n\nIf you encounter any issues, please report them on [GitHub Issues](https://github.com/yash2002vardhan/niftyfetcher/issues).\n\n## \u26a0\ufe0f Note on Rate Limits\n\nPlease be mindful of the rate limits imposed by the Upstox API to avoid errors or temporary bans. While this tool includes basic safeguards (such as delays between requests), it is ultimately your responsibility to ensure you do not exceed Upstox's allowed request limits. The authors are not liable for any issues arising from rate limit violations.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\ud83d\udcc8 A CLI tool to fetch historical OHLC data for stocks using Upstox API",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/yash2002vardhan/niftyfetcher",
        "Issues": "https://github.com/yash2002vardhan/niftyfetcher/issues",
        "Repository": "https://github.com/yash2002vardhan/niftyfetcher"
    },
    "split_keywords": [
        "cli",
        " data",
        " historical",
        " market",
        " nifty",
        " stock",
        " trading",
        " upstox"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "40dd13df4e372fca5728674e94efa0eee09f1aa83d4aaad6c966c4dd2b7f2baf",
                "md5": "22a0ce9ad1a240f253272d339a5b7de8",
                "sha256": "8d6d36f4c572fd08c923760e396e4dc403caff391a1449e32927df51d50afae1"
            },
            "downloads": -1,
            "filename": "niftyfetcher-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "22a0ce9ad1a240f253272d339a5b7de8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5755,
            "upload_time": "2025-07-21T09:58:46",
            "upload_time_iso_8601": "2025-07-21T09:58:46.443601Z",
            "url": "https://files.pythonhosted.org/packages/40/dd/13df4e372fca5728674e94efa0eee09f1aa83d4aaad6c966c4dd2b7f2baf/niftyfetcher-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "862d3006696497285762a7f2788a996246048988639dfef25c19d91fa0ca2db8",
                "md5": "fe3e82073bc16fefefa6818fcdb7b625",
                "sha256": "79a9e25ed23839bfd7f56af4e70a6b08afc74ca82dadcf3413d794be9aef7a15"
            },
            "downloads": -1,
            "filename": "niftyfetcher-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "fe3e82073bc16fefefa6818fcdb7b625",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5325,
            "upload_time": "2025-07-21T09:58:47",
            "upload_time_iso_8601": "2025-07-21T09:58:47.676265Z",
            "url": "https://files.pythonhosted.org/packages/86/2d/3006696497285762a7f2788a996246048988639dfef25c19d91fa0ca2db8/niftyfetcher-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-21 09:58:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yash2002vardhan",
    "github_project": "niftyfetcher",
    "github_not_found": true,
    "lcname": "niftyfetcher"
}
        
Elapsed time: 0.43504s