india-market-holidays (Python)
Indian market and bank holidays and business day adjustment in Python. A small client (standard library only) for the free marketholidays.in API: NSE, BSE, MCX, NSE settlement days, NSE currency derivatives, and RBI bank calendars for each city.
pip install india-market-holidays
The package installs the Python module marketholidays and a marketholidays command.
import marketholidays as mh
mh.is_business_day("2026-11-10", "nse") # False (Diwali-Balipratipada)
mh.adjust("2026-11-08", "nse") # date(2026, 11, 9)
mh.adjust("2026-10-31", "nse", "modified_following") # date(2026, 10, 30), stays in the month
mh.add_business_days("2026-10-19", 2, "nse") # date(2026, 10, 22), skips Dussehra
mh.business_days_between("2026-10-01", "2026-11-01", "nse") # 20
mh.is_business_day("2026-11-10", ["nse", "bank:mumbai"]) # open in every listed calendar?
mh.closed_reasons("2026-11-10", "nse,bank:mumbai")
Calendars: nse, bse, mcx, clearing, currency, bank, bank:<city> (for example bank:mumbai). Combine with commas or a list: a day is a business day only if it is open in all of them. mh.calendars() lists everything.
Conventions: following, modified_following, preceding, modified_preceding.
Command line
marketholidays check nse && ./fetch_prices.sh # exit 0 business day, 1 closed, 2 error
marketholidays adjust 2026-11-08 nse
marketholidays add 2026-10-19 2 nse
marketholidays between 2026-10-01 2026-11-01 nse
Years and errors
Only years whose official lists are published are served (2026 today). A request whose answer would depend on an unpublished year raises marketholidays.CalendarNotPublished rather than guessing. Other API problems raise marketholidays.MarketHolidaysError.
Notes
- Responses are cached in memory for an hour (
Client(cache_ttl=...)). Holiday data changes a few times a year. - This is a client for a web API, so it needs network access. Use
Client(base_url=...)to point at another host. - Dates come from NSE circulars and the RBI holiday matrix; confirm anything time-sensitive with your exchange or bank. See the API docs and terms.
MIT licensed. Not affiliated with NSE, BSE, MCX or the RBI.
Metadata
Release files for india-market-holidays 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| india_market_holidays-0.1.0.tar.gz | 5.9 kB | Without provenance | Details for india_market_holidays-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| india_market_holidays-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for india_market_holidays-0.1.0-py3-none-any.whl |
Total release size: 12.7 kB
Release files / india_market_holidays-0.1.0.tar.gz
| Download URL | india_market_holidays-0.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce9c50b4a800eb484c0e82a246884eacfdf45689f0a53eb52a638c7e19725692
|
|
BLAKE2b-256 checksum How to use checksums |
6516d5ab9cdab514a6acf546026cce36348e8d2191ca648d966eeb34d7c5b4f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / india_market_holidays-0.1.0-py3-none-any.whl
| Download URL | india_market_holidays-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc76ce249a9ffe70c27995e673587ab3f95a3eefb8a50ac49b0b87dcf5cb176a
|
|
BLAKE2b-256 checksum How to use checksums |
e728033774f710a5ed2e84e552a45a71f9217b0cce9b8623002490b4d0beccd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for india-market-holidays 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.