Metadata-Version: 2.4
Name: mcx-data
Version: 1.0.0
Summary: Download MCX India commodity market data as pandas DataFrames — spot prices (recent + archive), futures bhavcopy. Works on AWS Lambda.
Author-email: Nikhil Suthar <nikhil.suthar@lumiq.ai>
License-Expression: MIT
Project-URL: Homepage, https://github.com/NikhilSuthar/indian-market-data
Project-URL: Documentation, https://NikhilSuthar.github.io/indian-market-data
Project-URL: Repository, https://github.com/NikhilSuthar/indian-market-data
Project-URL: Bug Tracker, https://github.com/NikhilSuthar/indian-market-data/issues
Keywords: mcx,mcx-data,mcx-india,commodity,futures,options,gold,silver,crude-oil,natural-gas,india,market-data,financial-data,pandas,bhavcopy,trading,historical-data
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: openpyxl>=3.1.0
Requires-Dist: curl-cffi>=0.7.0
Provides-Extra: s3
Requires-Dist: boto3>=1.28.0; extra == "s3"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff; extra == "dev"

# mcx-data

[![PyPI version](https://badge.fury.io/py/mcx-data.svg)](https://pypi.org/project/mcx-data/)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Download **MCX India** commodity spot market data as pandas DataFrames. Works from **AWS Lambda** and any cloud environment.

**Full Documentation → [NikhilSuthar.github.io/indian-market-data/mcx-spot](https://NikhilSuthar.github.io/indian-market-data/mcx-spot)**

Part of the [indian-market-data](https://github.com/NikhilSuthar/indian-market-data) monorepo — also see [`nse-data`](https://pypi.org/project/nse-data/).

```bash
pip install mcx-data
```

## Quick Start

```python
from mcxdata import mcx

# Today's spot prices — all 28 commodities
df = mcx.get_spot_recent()

# Single commodity
df = mcx.get_spot_recent(commodity="GOLD")

# Historical (requires specific commodity)
df = mcx.get_spot_archive("2026-05-01", "2026-05-22", commodity="GOLD")
df = mcx.get_spot_archive("2026-05-01", "2026-05-22", commodity="SILVER")

# Download to S3
mcx.download("spot", "market", "spot_recent",
             s3_bucket="my-bucket", s3_prefix="raw/mcx/")

# Available commodities (28)
mcx.list_commodities()
```

## Datasets

| Dataset | Description | Date Param |
|---------|-------------|-----------|
| `spot_recent` | Today's spot prices — all 28 commodities | None |
| `spot_archive` | Historical spot prices by commodity + date range | `from_date`, `to_date` |

## Available Commodities (28)

`ALUMINI, ALUMINIUM, CARDAMOM, COPPER, COTTON, COTTONOIL, CPO, CRUDEOIL, CRUDEOILM, ELECDMBL, GOLD, GOLDGUINEA, GOLDM, GOLDPETAL, GOLDTEN, KAPAS, LEAD, LEADMINI, MENTHAOIL, NATGASMINI, NATURALGAS, NICKEL, SILVER, SILVERM, SILVERMIC, STEELREBAR, ZINC, ZINCMINI`

## Notes

- MCX archive requires a **specific commodity** — `"ALL"` returns empty (MCX API limitation)
- Uses `curl-cffi` Chrome TLS impersonation to bypass MCX Akamai WAF
- Lambda IPs are generally unblocked — works reliably on AWS

## License

MIT — data from [MCX India](https://www.mcxindia.com).
