Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leogregianin/stock-exchange-holidays
Worldwide Stock Exchange holidays (NYSE, CME, B3)
https://github.com/leogregianin/stock-exchange-holidays
Last synced: about 18 hours ago
JSON representation
Worldwide Stock Exchange holidays (NYSE, CME, B3)
- Host: GitHub
- URL: https://github.com/leogregianin/stock-exchange-holidays
- Owner: leogregianin
- Created: 2021-04-10T21:23:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-18T13:56:26.000Z (about 1 year ago)
- Last Synced: 2024-09-21T10:38:48.191Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Worldwide Stock Exchange holidays
[![PyPI](https://img.shields.io/pypi/v/stock_exchange_holidays)](https://pypi.org/project/stock_exchange_holidays/)[![stock-exchange-holidays](https://github.com/leogregianin/stock-exchange-holidays/actions/workflows/main.yml/badge.svg)](https://github.com/leogregianin/stock-exchange-holidays/actions/workflows/main.yml)[![codecov](https://codecov.io/gh/leogregianin/stock-exchange-holidays/branch/main/graph/badge.svg)](https://codecov.io/gh/leogregianin/stock-exchange-holidays)
## Install
From source:
```sh
$ python setup.py install
```From PyPi:
```sh
$ pip install stock-exchange-holidays
```## Development
### Create virtual environment
```sh
$ virtualenv .venv
$ source .venv/bin/activate
```### Install development dependencies
```sh
$ pip install -r requirements-dev.txt
```### Run tests
```sh
$ python -m unittest
```## Using
### New York Stock Exchange (NYSE)
```python
from stock.stock_exchange_holidays import Holidays, NYSEholidays = Holidays(exchange=NYSE())
print(holidays.get_holidays())
print(holidays.get_holidays_by_year(year=2021))
```##### Is specific date holiday in NYSE?
```python
from datetime import date
from stock.stock_exchange_holidays import Holidays, NYSEfirst_day = date(2020, 1, 1)
holidays = Holidays(exchange=NYSE())
holidays.is_date_holiday(first_day)
```### Chicago Mercantile Exchange (CME)
```python
from stock.stock_exchange_holidays import Holidays, CMEholidays = Holidays(exchange=CME())
print(holidays.get_holidays())
print(holidays.get_holidays_by_year(year=2021))
```##### Is specific date holiday in CME?
```python
from datetime import date
from stock.stock_exchange_holidays import Holidays, CMEfirst_day = date(2020, 1, 1)
holidays = Holidays(exchange=CME())
holidays.is_date_holiday(first_day)
```### Sao Paulo Stock exchange (B3) formerly BM&F-BOVESPA
```python
from stock.stock_exchange_holidays import Holidays, B3holidays = Holidays(exchange=B3())
print(holidays.get_holidays())
print(holidays.get_holidays_by_year(year=2021))
```##### Is specific date holiday in B3?
```python
from datetime import date
from stock.stock_exchange_holidays import Holidays, B3first_day = date(2020, 1, 1)
holidays = Holidays(exchange=B3())
holidays.is_date_holiday(first_day)
```## License
MIT