Skip to content

Add Bombay Stock Exchange (BSE) holidays#3170

Merged
arkid15r merged 13 commits intovacanza:devfrom
pareshjoshij:add-bombay-stock-exchange
Dec 29, 2025
Merged

Add Bombay Stock Exchange (BSE) holidays#3170
arkid15r merged 13 commits intovacanza:devfrom
pareshjoshij:add-bombay-stock-exchange

Conversation

@pareshjoshij
Copy link
Copy Markdown
Contributor

Proposed change

This PR adds support for the Bombay Stock Exchange (BSE), market code XBOM.

Closes #3149

Implementation Details:
As discussed in the linked issue, the BSE shares an identical holiday calendar with the National Stock Exchange (NSE) as both are regulated by SEBI.

Following the feedback from @arkid15r regarding structural consistency and long-term perspective, I have implemented this as a separate class that inherits from NationalStockExchangeOfIndia, rather than just adding an alias. This ensures the correct directory structure while avoiding code duplication for the holiday logic.

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

Copilot AI review requested due to automatic review settings December 26, 2025 06:45
@github-actions github-actions bot added the test label Dec 26, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 26, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Summary by CodeRabbit

  • New Features

    • Added Bombay Stock Exchange (BSE / XBOM) financial market holiday calendar (coverage from 2001 onward).
  • Localization

    • Added localization templates for XBOM in English (India), English (US), Gujarati, and Hindi.
  • Documentation

    • Updated available financial markets table to include Bombay Stock Exchange.
  • Tests

    • Added unit tests validating XBOM holidays and localized holiday names.
  • Bug Fixes

    • Improved fallback logic for parent-entity translation lookups.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Adds a Bombay Stock Exchange (XBOM / BSE) financial calendar subclassing NationalStockExchangeOfIndia, registers and exports it, adds locale PO templates and unit tests, and makes parent-translation fallback lookup more robust.

Changes

Cohort / File(s) Summary
Documentation
README.md
Inserted Bombay Stock Exchange (XBOM) row in Available Financial Markets with locales en_IN, en_US, gu, hi.
New financial calendar
holidays/financial/bombay_stock_exchange.py, holidays/financial/__init__.py
Add BombayStockExchange (extends NationalStockExchangeOfIndia) with market = "XBOM", parent_entity = NationalStockExchangeOfIndia, start_year = 2001; export aliases XBOM, BSE.
Registry
holidays/registry.py
Add bombay_stock_exchange entry to FINANCIAL mapping as ("BombayStockExchange", "XBOM", "BSE").
Tests
tests/financial/test_bombay_stock_exchange.py
New tests verifying holiday presence and localized names for default, en_US, gu, and hi locales (2023).
Translation fallback
holidays/holiday_base.py
_init_translation now uses getattr(parent_entity, "country", None) or getattr(parent_entity, "market", None) for parent fallback lookup.
Locales
holidays/locale/en_IN/LC_MESSAGES/XBOM.po, holidays/locale/en_US/LC_MESSAGES/XBOM.po, holidays/locale/gu/LC_MESSAGES/XBOM.po, holidays/locale/hi/LC_MESSAGES/XBOM.po
Add empty gettext template files (headers only) for XBOM in four locales.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • arkid15r
  • KJhellico
  • PPsyrius

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and concisely summarizes the primary change: adding Bombay Stock Exchange (BSE) holidays support with market code XBOM.
Description check ✅ Passed Description is directly related to the changeset, explaining the BSE implementation as a separate class inheriting from NationalStockExchangeOfIndia to reuse holiday logic.
Linked Issues check ✅ Passed All coding requirements from issue #3149 are met: BombayStockExchange class created [#3149], inherits from NationalStockExchangeOfIndia [#3149], market set to XBOM [#3149], and reuses NSE holiday logic [#3149].
Out of Scope Changes check ✅ Passed Changes in holiday_base.py enhance translation fallback robustness for parent entity lookups, supporting the new inheritance pattern while remaining within scope of adding BSE support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f6d941e and 6103b6d.

📒 Files selected for processing (6)
  • holidays/financial/__init__.py
  • holidays/financial/bombay_stock_exchange.py
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/hi/LC_MESSAGES/XBOM.po
🧰 Additional context used
🧠 Learnings (50)
📓 Common learnings
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2834
File: holidays/financial/national_stock_exchange_of_india.py:38-44
Timestamp: 2025-08-26T20:10:05.288Z
Learning: For National Stock Exchange of India (NSE) holidays implementation, only `estimated_label = tr("%s (estimated)")` is needed for localization support. The `observed_label` and `observed_estimated_label` are not required for this financial market holidays implementation.
📚 Learning: 2025-06-28T10:39:19.185Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.185Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-06-29T09:37:35.283Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2687
File: holidays/locale/en_US/LC_MESSAGES/CF.po:13-28
Timestamp: 2025-06-29T09:37:35.283Z
Learning: In the holidays project, .po files follow a standard formatting convention where there is always a blank line after the metadata header section (after the "X-Source-Language" line). This blank line separates the header from the actual translation content and should not be removed.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-03-05T17:51:00.633Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:30-299
Timestamp: 2025-03-05T17:51:00.633Z
Learning: In the Holidays project, .po files for a country's default locale use empty msgstr fields as a standard convention.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-06-10T12:17:58.880Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2608
File: holidays/locale/en_VC/LC_MESSAGES/VC.po:1-14
Timestamp: 2025-06-10T12:17:58.880Z
Learning: In the holidays project, .po files should use the full multi-line header format including the project description, authors, website, and license information, rather than a single-line comment format.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-06-26T15:34:35.476Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2676
File: holidays/locale/en_US/LC_MESSAGES/TN.po:17-28
Timestamp: 2025-06-26T15:34:35.476Z
Learning: In the holidays project, .po file header metadata updates (version numbers, revision dates, translator information) are legitimate changes when part of localization work and don't require `make l10n` regeneration. The `make l10n` command is primarily for formatting fixes and missing translator comments, not for intentional metadata updates.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-06-11T18:32:25.595Z
Learnt from: ankushhKapoor
Repo: vacanza/holidays PR: 2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-03-30T13:33:31.598Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2388
File: holidays/locale/fr/LC_MESSAGES/CI.po:28-101
Timestamp: 2025-03-30T13:33:31.598Z
Learning: In the holidays library, for localization files of the default language (like French for Ivory Coast in fr/LC_MESSAGES/CI.po), the best practice is to leave the message strings (msgstr) empty to avoid possible typos, since the message IDs (msgid) are already in the target language.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
📚 Learning: 2025-05-10T04:34:02.406Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2537
File: holidays/locale/sv_FI/LC_MESSAGES/AX.po:17-27
Timestamp: 2025-05-10T04:34:02.406Z
Learning: The `Plural-Forms` header isn't used in .po file generation for the holidays project and doesn't need to be manually added to localization files.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-06-06T15:22:39.950Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2607
File: scripts/l10n/l10n_helper.py:147-150
Timestamp: 2025-06-06T15:22:39.950Z
Learning: In the holidays project localization system, all .po files are generated from the same .pot template for all supported languages, ensuring that all msgids exist for all languages. This makes defensive programming for missing language keys in po_data[msgid] unnecessary in the normal workflow.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-05-09T18:34:33.990Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2537
File: holidays/countries/finland.py:195-199
Timestamp: 2025-05-09T18:34:33.990Z
Learning: In the holidays library, localization (l10n) is handled through separate .po files for different languages rather than combining multiple translations in a single string. The code should use the default language with tr() function, and translations are provided in language-specific .po files.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
📚 Learning: 2025-03-08T11:28:48.652Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:285-299
Timestamp: 2025-03-08T11:28:48.652Z
Learning: In the holidays project, message IDs (msgids) in locale files use region-specific naming conventions (e.g., "Muharram", "Id-ul-Fitr" in en_IN locale for India), while translator comments use internationally recognized names from the project's default locale (en_US) such as "Ashura", "Eid al-Fitr". This difference is intentional for proper localization.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-03-30T18:25:07.087Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-08-26T20:10:05.288Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2834
File: holidays/financial/national_stock_exchange_of_india.py:38-44
Timestamp: 2025-08-26T20:10:05.288Z
Learning: For National Stock Exchange of India (NSE) holidays implementation, only `estimated_label = tr("%s (estimated)")` is needed for localization support. The `observed_label` and `observed_estimated_label` are not required for this financial market holidays implementation.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/financial/bombay_stock_exchange.py
  • holidays/financial/__init__.py
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-05-06T15:25:44.333Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2530
File: holidays/locale/ca/LC_MESSAGES/AD.po:31-40
Timestamp: 2025-05-06T15:25:44.333Z
Learning: In the Holidays project, msgid fields in localization files contain strings in the entity's default language (as defined by default_language attribute), not English source strings as in standard gettext implementations.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-09-07T19:28:19.153Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2888
File: holidays/financial/national_stock_exchange_of_india.py:110-112
Timestamp: 2025-09-07T19:28:19.153Z
Learning: For National Stock Exchange of India (NSE) holidays implementation in holidays/financial/national_stock_exchange_of_india.py, "Mahatma Gandhi Jayanti" is the official name used in NSE source documentation for Gandhi Jayanti (October 2nd), even though snapshots and localization files may use the shorter "Gandhi Jayanti" form. Source accuracy takes precedence over standardization.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/financial/bombay_stock_exchange.py
  • holidays/financial/__init__.py
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-09-26T13:58:49.363Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2960
File: holidays/locale/ca/LC_MESSAGES/ES.po:148-151
Timestamp: 2025-09-26T13:58:49.363Z
Learning: In the holidays project, when translating holiday names in .po files, the msgstr should be a faithful translation of the original msgid (in the country's default language), not influenced by English commentary or common en_US names. For example, "Día de la Pascua Granada" (Spanish) correctly translates to "Dia de la Pasqua Granada" (Catalan), even though the English comment refers to it as "Whit Monday".

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-06-25T10:09:29.029Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2676
File: holidays/locale/ar/LC_MESSAGES/EG.po:0-0
Timestamp: 2025-06-25T10:09:29.029Z
Learning: In the holidays library, msgstr fields can be left empty for source/default_language files when using Lingva, the localization tool used by the project.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XBOM.po
  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-04-17T17:08:48.082Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2438
File: holidays/locale/ar_IQ/LC_MESSAGES/IQ.po:35-81
Timestamp: 2025-04-17T17:08:48.082Z
Learning: In holiday PO files, when the file represents the default language of an entity (e.g., ar_IQ for Iraq), no translations in `msgstr` are required as the `msgid` values are already in the target language.

Applied to files:

  • holidays/locale/gu/LC_MESSAGES/XBOM.po
  • holidays/financial/bombay_stock_exchange.py
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-03-31T20:25:12.808Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2398
File: holidays/locale/fr/LC_MESSAGES/GN.po:31-83
Timestamp: 2025-03-31T20:25:12.808Z
Learning: In the holidays library, French (fr) is the default language for Guinea. This means that message IDs (msgid) in the PO files are already in French, and message strings (msgstr) in the French locale files can remain empty, as no translation is needed.

Applied to files:

  • holidays/locale/gu/LC_MESSAGES/XBOM.po
📚 Learning: 2025-04-13T19:11:32.337Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2465
File: holidays/locale/nl/LC_MESSAGES/SR.po:31-32
Timestamp: 2025-04-13T19:11:32.337Z
Learning: In the holidays library, when a language is set as the default language for a country (like Dutch/nl for Suriname), the `msgid` strings in the PO file are already in that language, and the corresponding `msgstr` fields are intentionally left empty. This is by design, as the system will fall back to using the `msgid` value when no translation is provided.

Applied to files:

  • holidays/locale/gu/LC_MESSAGES/XBOM.po
📚 Learning: 2025-09-26T13:44:12.652Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2960
File: holidays/locale/ca/LC_MESSAGES/ES.po:97-100
Timestamp: 2025-09-26T13:44:12.652Z
Learning: When fixing localization issues in the holidays project, corrections should be made in both the Python source code comments and the en_US .po file msgstr entries, then all other language .po files should be regenerated to pick up the corrected en_US comments.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
📚 Learning: 2025-06-10T05:08:07.939Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2608
File: holidays/locale/en_US/LC_MESSAGES/VC.po:76-76
Timestamp: 2025-06-10T05:08:07.939Z
Learning: For the holidays project, localization file formatting issues (like missing terminal periods in .po files) should be automatically fixed by running `make l10n` command (which is included in `make check`). Authors should be directed to use this automated tooling instead of manual formatting fixes.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
📚 Learning: 2025-09-06T20:47:29.638Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2888
File: holidays/financial/national_stock_exchange_of_india.py:153-155
Timestamp: 2025-09-06T20:47:29.638Z
Learning: For National Stock Exchange of India (NSE) holidays implementation, Buddha Purnima was officially observed as a trading holiday from 2006-2009 according to official NSE circulars, as confirmed by maintainer review of comprehensive official sources.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
  • holidays/financial/bombay_stock_exchange.py
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-08-30T12:52:58.539Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2834
File: tests/financial/test_national_stock_exchange_of_india.py:342-360
Timestamp: 2025-08-30T12:52:58.539Z
Learning: In the NSE holidays implementation, assertLocalizedHolidays should only include holidays that are actually observed (trading holidays), not holidays that fall on weekends and are excluded by the observed_rule. For example, Eid al-Fitr 2023 falls on Saturday and is correctly excluded from localization tests.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
📚 Learning: 2025-03-31T11:50:50.488Z
Learnt from: Wasif-Shahzad
Repo: vacanza/holidays PR: 2385
File: holidays/countries/pakistan.py:59-60
Timestamp: 2025-03-31T11:50:50.488Z
Learning: In the holidays library, function names and comments follow en_US spelling conventions (e.g., "Labor Day"), while the default strings may use different locale conventions (e.g., "Labour Day" for en_PK) and are translated appropriately using the gettext function.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
📚 Learning: 2025-05-10T04:02:13.815Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
📚 Learning: 2025-12-17T14:46:04.977Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 3138
File: holidays/locale/en_US/LC_MESSAGES/SE.po:99-99
Timestamp: 2025-12-17T14:46:04.977Z
Learning: Enforce that message comments in PO files under holidays/locale/en_US/LC_MESSAGES/*.po end with a period. For example, change '# Midsummer Eve' to '# Midsummer Eve.' to maintain consistency with other holiday comments. During reviews, scan for trailing punctuation in comments and ensure uniformity across all locale entries.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XBOM.po
📚 Learning: 2025-08-08T14:37:03.045Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2774
File: tests/countries/test_liberia.py:15-16
Timestamp: 2025-08-08T14:37:03.045Z
Learning: In holidays/countries/__init__.py, re-export country classes using absolute imports (e.g., 'from holidays.countries.liberia import Liberia, LR, LBR') and keep alphabetical ordering (e.g., Lesotho, Liberia, Libya). Avoid relative imports in this file.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
  • holidays/financial/__init__.py
📚 Learning: 2025-08-20T19:46:15.625Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2833
File: tests/countries/test_uganda.py:15-0
Timestamp: 2025-08-20T19:46:15.625Z
Learning: In the holidays project, the standard import pattern for country test files is `from holidays.countries.<country> import Country, CODE1, CODE2` (direct module import), used by ~75% of country test files. Only a minority (~25%) use the aggregated public API import `from holidays.countries import Country, CODE1, CODE2`. The direct module import pattern should be used for new country test files to follow the established convention.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-08-28T21:03:22.954Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2831
File: README.md:1557-1563
Timestamp: 2025-08-28T21:03:22.954Z
Learning: When checking exports in holidays/countries/__init__.py, look for simple import statements like "from .module_name import Class, CODE1, CODE2" rather than using complex regex patterns. The import statements follow a straightforward format.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-08-09T18:31:23.218Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2778
File: tests/countries/test_kiribati.py:15-15
Timestamp: 2025-08-09T18:31:23.218Z
Learning: In the holidays project test files, the standard import pattern is `from holidays.countries.<country> import Country, CODE1, CODE2` (used in ~97% of test files), not `from holidays.countries import Country, CODE1, CODE2`. Only a few exceptions (Suriname, Sierra Leone, Mauritius, Mali, Ivory Coast, Guyana) use the aggregated import pattern.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
Repo: vacanza/holidays PR: 2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
  • holidays/financial/__init__.py
📚 Learning: 2025-08-08T14:37:03.045Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2774
File: tests/countries/test_liberia.py:15-16
Timestamp: 2025-08-08T14:37:03.045Z
Learning: When adding a new country in vacanza/holidays, also re-export it in holidays/countries/__init__.py (e.g., from .liberia import Liberia, LR, LBR) so tests and users can import from holidays.countries consistently.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-08-21T05:56:33.276Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2843
File: holidays/countries/burundi.py:15-16
Timestamp: 2025-08-21T05:56:33.276Z
Learning: In the holidays library, when importing Gregorian month constants from holidays.calendars.gregorian, only import the months that are actually used in the date data. For example, if Islamic holiday dates only reference JUN, JUL, SEP, OCT, then only import those specific constants rather than importing additional unused months.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-07-10T21:08:23.709Z
Learnt from: Harshil-Gupta
Repo: vacanza/holidays PR: 2704
File: holidays/countries/pitcairn_islands.py:26-31
Timestamp: 2025-07-10T21:08:23.709Z
Learning: British territories in the holidays library (like Falkland Islands and Pitcairn Islands) should use default_language = "en_GB" to reuse existing British English translations rather than creating territory-specific locale files like en_FK or en_PN.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-06-18T10:07:58.780Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2642
File: holidays/countries/french_southern_territories.py:41-44
Timestamp: 2025-06-18T10:07:58.780Z
Learning: Territorial holiday classes that inherit from parent countries (like HolidaysAX from Finland, HolidaysSJ from Norway, HolidaysTF from France) follow a standard pattern of silently overriding self.subdiv in their _populate_public_holidays() method without validation, as this ensures they always use the correct subdivision code for their territory regardless of user input.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-08-26T21:24:41.827Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2860
File: holidays/countries/burkina_faso.py:27-30
Timestamp: 2025-08-26T21:24:41.827Z
Learning: Countries in the holidays library that don't have localization support yet should use plain English strings for labels (e.g., `estimated_label = "%s (estimated)"`), while only countries with existing .po translation files should use `tr()` wrapping. Check for the presence of .po files in holidays/locale to determine if a country has localization support.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
📚 Learning: 2025-06-25T20:55:00.642Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2651
File: holidays/locale/nl/LC_MESSAGES/BQ.po:29-95
Timestamp: 2025-06-25T20:55:00.642Z
Learning: In the holidays library, Dutch locale files (.po) with `X-Source-Language: nl` should have empty msgstr entries when the target language is also Dutch. The library uses fallback=True with gettext, which returns the original msgid when msgstr is empty. This is the correct pattern for native language files and does not cause blank holiday names.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-06-16T11:46:35.303Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's standard practice to hardcode a specific subdivision code in the _populate methods since the subdivision codes for the parent country yield identical results. The Åland Islands implementation serves as the reference pattern for this approach.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-05-10T04:35:01.221Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2537
File: holidays/locale/th/LC_MESSAGES/AX.po:15-27
Timestamp: 2025-05-10T04:35:01.221Z
Learning: The localization (.po) files for Åland Islands (AX) are intentionally left as stubs without translations because Åland Islands is implemented as a subdivision of Finland (code "01"). Holiday translations are handled through the Finland (FI) localization files instead.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-06-16T11:46:35.303Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's common and acceptable to hardcode a specific subdivision code since the subdivision codes for the parent country yield identical results.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-06-18T10:18:59.447Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2642
File: holidays/countries/france.py:178-182
Timestamp: 2025-06-18T10:18:59.447Z
Learning: In the France holidays implementation, deprecated subdivision names like "Alsace-Moselle" and "Saint-Barthélémy" are handled through explicit conditionals in _populate_public_holidays() that map them to their corresponding new subdivision-specific holiday population methods, providing backward compatibility while users transition to the new ISO codes.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-08-25T10:51:08.068Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2831
File: holidays/countries/south_sudan.py:21-30
Timestamp: 2025-08-25T10:51:08.068Z
Learning: In the holidays library, references in country/market holiday implementations should be ordered as follows: Wikipedia links for the country/market holidays first, then country-specific official sources for newer implementations, then Wikipedia links for each individual non-standard holiday if any are required. Official government sources should not be placed first ahead of Wikipedia links.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
  • holidays/financial/__init__.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
  • holidays/financial/__init__.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.

Applied to files:

  • holidays/financial/bombay_stock_exchange.py
📚 Learning: 2025-08-11T13:48:45.953Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2794
File: holidays/calendars/ethiopian.py:13-13
Timestamp: 2025-08-11T13:48:45.953Z
Learning: The holidays library does not use `__all__` declarations in calendar modules (holidays/calendars/). Calendar files follow a standard pattern of defining constants and functions directly without explicit exports, similar to the convention used in country modules.

Applied to files:

  • holidays/financial/__init__.py
📚 Learning: 2025-03-04T11:32:45.095Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.

Applied to files:

  • holidays/financial/__init__.py
📚 Learning: 2025-03-04T11:32:45.095Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (like `special_government_holidays`, `special_mandatory_holidays`, and `special_public_holidays`), which are utilized by syntactic sugar methods to pick up the appropriate holidays based on the selected category.

Applied to files:

  • holidays/financial/__init__.py
📚 Learning: 2025-09-17T15:53:16.940Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2944
File: holidays/countries/myanmar.py:108-111
Timestamp: 2025-09-17T15:53:16.940Z
Learning: In the holidays package, explanatory comments about year restrictions or policy context should be placed above conditional blocks or at method level, never directly above holiday name comments that precede tr() function calls, as this would include the explanatory text in .po localization files when running `make l10n`.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XBOM.po
🧬 Code graph analysis (2)
holidays/financial/bombay_stock_exchange.py (1)
holidays/financial/national_stock_exchange_of_india.py (1)
  • NationalStockExchangeOfIndia (26-177)
holidays/financial/__init__.py (1)
holidays/financial/bombay_stock_exchange.py (3)
  • BombayStockExchange (16-25)
  • XBOM (28-29)
  • BSE (32-33)
🔇 Additional comments (6)
holidays/locale/en_IN/LC_MESSAGES/XBOM.po (1)

1-27: LGTM!

The PO file structure is correct. The header comment uses the proper format for a default language file (without locale suffix), and the empty translation block is appropriate since this market uses the parent_entity feature to inherit translations from NationalStockExchangeOfIndia.

holidays/financial/__init__.py (1)

13-13: LGTM!

The import statement correctly exposes BombayStockExchange and its aliases (XBOM, BSE) following the established pattern for financial markets. Alphabetical ordering is maintained.

holidays/locale/hi/LC_MESSAGES/XBOM.po (1)

1-27: LGTM!

The Hindi locale file follows the correct format for a non-default language file, with the proper header comment including the locale suffix. The empty translation block is appropriate for parent_entity fallback.

holidays/locale/gu/LC_MESSAGES/XBOM.po (1)

1-27: LGTM!

The Gujarati locale file follows the correct format for a non-default language file. Structure and header comment are properly formatted for parent_entity translation fallback.

holidays/financial/bombay_stock_exchange.py (1)

13-33: LGTM!

The implementation correctly uses the parent_entity feature to inherit holiday logic from NationalStockExchangeOfIndia, avoiding duplication of complex Hindu/Islamic calendar rules. The market code, start year, and alias classes are all properly defined.

holidays/locale/en_US/LC_MESSAGES/XBOM.po (1)

1-27: LGTM!

The en_US locale file follows the correct format for a non-default language file. The header comment properly includes the locale suffix, and the file structure supports parent_entity translation inheritance.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the Bombay Stock Exchange (BSE) with market code XBOM to the holidays library. Since BSE shares an identical holiday calendar with the National Stock Exchange (NSE) due to SEBI regulation, the implementation uses inheritance to avoid code duplication while maintaining proper directory structure.

Key Changes

  • New BombayStockExchange class that inherits from NationalStockExchangeOfIndia
  • Comprehensive test suite covering all holidays and localizations (en_IN, en_US, gu, hi)
  • Registry entry with aliases (XBOM, BSE)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
holidays/financial/bombay_stock_exchange.py New implementation that inherits from NSE, cleverly reuses XNSE translations via _init_translation override
tests/financial/test_bombay_stock_exchange.py Comprehensive test suite covering all holidays, observed/non-observed dates, and localizations
holidays/registry.py Added registry entry for bombay_stock_exchange with XBOM and BSE aliases
README.md Documentation table entry for Bombay Stock Exchange with supported languages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 26, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 26, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@KJhellico KJhellico changed the title Add Bombay Stock Exchange (BSE) #3149 Add Bombay Stock Exchange (BSE) holidays Dec 26, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 27, 2025
@pareshjoshij
Copy link
Copy Markdown
Contributor Author

@KJhellico sir , I've pushed all the requested fixes in commit f6d941e.

However, the PR diff is still showing the old files. I'm not sure if this is a GitHub glitch or if I made a mistake while pushing. Could you please check the commit directly to verify the changes? Thanks!

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0f65700) to head (6103b6d).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3170   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          306       307    +1     
  Lines        18288     18298   +10     
  Branches      2336      2336           
=========================================
+ Hits         18288     18298   +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 27, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 28, 2025
@pareshjoshij
Copy link
Copy Markdown
Contributor Author

@KJhellico sir , I noticed something about the .po file generation. Currently, the script creates a pretty bare header, so I had to manually add standard fields like Project-Id-Version, Language-Team, MIME-Version, and Content-Type to ensure it matched the existing files.

IMO, we should update the generation script (scripts/l10n/generate_po_files.py) to automatically populate these technical fields with standard defaults (setting UTF-8, pulling the version from the package, setting the default Team, etc.).

It would make the process much smoother for future contributors so they only need to fill in their Name/Email

@KJhellico
Copy link
Copy Markdown
Collaborator

IMO, we should update the generation script

Yes, that would be helpful.

Co-authored-by: ~Jhellico <[email protected]>
Signed-off-by: Paresh Joshi <[email protected]>
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 29, 2025
Signed-off-by: Paresh Joshi <[email protected]>
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 29, 2025
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Copy Markdown
Collaborator

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🇮🇳

@pareshjoshij
Copy link
Copy Markdown
Contributor Author

Thank you @KJhellico and @PPsyrius for the review and approval!
​Sorry for the silly mistakes earlier—I was rushing to finish this while working on other tasks. I appreciate the guidance on the formatting and will ensure I check everything properly before pushing next time.

Copy link
Copy Markdown
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pareshjoshij thanks for both -- the idea and implementation.

@arkid15r arkid15r added this pull request to the merge queue Dec 29, 2025
Merged via the queue into vacanza:dev with commit 900ec92 Dec 29, 2025
35 checks passed
@pareshjoshij pareshjoshij deleted the add-bombay-stock-exchange branch December 30, 2025 00:18
@arkid15r arkid15r mentioned this pull request Jan 5, 2026
@coderabbitai coderabbitai bot mentioned this pull request Mar 9, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Bombay Stock Exchange (BSE) via inheritance from NSE

5 participants