Metadata-Version: 2.4
Name: open-market-calendar
Version: 0.1.0
Summary: Is the stock market open right now? Market hours, holidays and early closes for NYSE, Nasdaq, NSE, PSX, NGX, Tadawul and more, from each exchange's own published list. No API key.
Author: TradingLookup
License: MIT
Project-URL: Homepage, https://tradinglookup.com/market-hours/
Project-URL: Data, https://tradinglookup.com/data/market-calendar.json
Keywords: market hours,stock market holidays,trading calendar,exchange calendar,nyse,nasdaq,nse,psx,ngx,tadawul
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tzdata; platform_system == "Windows"
Dynamic: license-file

# open-market-calendar

Is the stock market open right now? This package answers from one open data file, on your own machine. No API key, no account, no call to a server per question.

The data is the [TradingLookup Open Market Calendar](https://tradinglookup.com/market-hours/): market hours, holidays and early closes taken from each exchange's own published list.

## Install

```
pip install open-market-calendar
```

## Use

```python
from open_market_calendar import load_calendar, market_status, is_open, upcoming_days

cal = load_calendar()            # fetch once, then keep it

market_status(cal, "nyse")
# {'state': 'open', 'reason': 'closes 16:00', 'local': '10:42', 'date': '2026-11-24'}

is_open(cal, "nse")              # True, False, or None when the file cannot say
upcoming_days(cal, "nyse")[:2]   # next closed days and early closes, each with its source page
```

`market_status(calendar, slug, now=None)` returns `state` (`open`, `closed` or `unknown`), a short `reason`, and the market's local time and date. Pass a timezone-aware `datetime` as `now` to ask about another moment.

Python 3.9+. Standard library only.

To put the dated rows in pandas:

```python
import pandas as pd
df = pd.DataFrame({"market": m["slug"], **d} for m in cal["markets"] for d in m["days"])
```

## What is in the file

One entry per market: time zone, regular sessions, and every closed day, early close and special session we have read from the market's own published list. Each dated row carries the official page it came from (`source_url`) and the date we read it (`checked_at`).

Markets with a holiday feed today: NYSE, Nasdaq, London Stock Exchange, NSE and BSE (India), Pakistan Stock Exchange, Nigerian Exchange, Saudi Exchange (Tadawul), the US bond market (SIFMA) and CME futures.

- Data file: https://tradinglookup.com/data/market-calendar.json
- Same rows as a table: https://tradinglookup.com/data/market-calendar.csv
- Calendar feeds (.ics) you can subscribe to: https://tradinglookup.com/market-hours/

## Limits, stated plainly

- Coverage differs per market. Each market has `covers.from` and `covers.to`; outside those dates the answer is `unknown`, never a guess.
- A market with no confirmed regular hours in the file also answers `unknown`.
- This is reference data, not trading advice. Check the market's official page before you trade.

## Licence

Code: MIT. Data: CC BY 4.0. If you use the data, credit "TradingLookup Open Market Calendar" with a link to https://tradinglookup.com/market-hours/
