Skip to content

Add Japan Exchange Group (JPX) holidays#3270

Merged
arkid15r merged 54 commits intovacanza:devfrom
adityaanand05:dev
Mar 6, 2026
Merged

Add Japan Exchange Group (JPX) holidays#3270
arkid15r merged 54 commits intovacanza:devfrom
adityaanand05:dev

Conversation

@adityaanand05
Copy link
Copy Markdown
Contributor

@adityaanand05 adityaanand05 commented Feb 14, 2026

Proposed change

This PR adds support for the Japan Exchange under financial markets by introducing a new file japan_exchange.py.

The implementation follows the existing financial market structure and conventions used across the project. The file defines the official trading holidays observed by the Japan Exchange, enabling users to retrieve exchange-specific holidays through the financials module.

This addition expands financial market coverage within the library.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 14, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a Japan Exchange (XJPX/JPX/TSE/OSE) financial calendar, registers and re-exports it, updates README market listing, adds XJPX locale PO files (en_US, ja, th), modifies JP locale PO files, tweaks holiday_base entity_code fallback, and adds tests for JPX behavior.

Changes

Cohort / File(s) Summary
Core implementation
holidays/financial/japan_exchange.py, holidays/financial/__init__.py, holidays/registry.py
New JapanExchange calendar (market="XJPX", start_year=1949) with market-closure rules (adds Jan 2, Jan 3, Dec 31 as market holidays), supported_categories=(PUBLIC,), alias classes XJPX, JPX, TSE, OSE; re-exported from package; FINANCIAL registry entry japan_exchange added.
Tests
tests/financial/test_japan_exchange.py
New test suite TestJapanExchange covering init, market holiday dates (including weekend/substitute handling), citizens holiday, special one-offs, and pre/post start-year bounds.
Documentation
README.md
Inserted "Japan Exchange" row into the "Available Financial Markets" table with code XJPX and supported languages en_US, ja, th.
Locale: JP (updated)
holidays/locale/en_US/LC_MESSAGES/JP.po, holidays/locale/ja/LC_MESSAGES/JP.po, holidays/locale/th/LC_MESSAGES/JP.po
Added translations/entries for 市場休業日 (Market Holiday) and 銀行休業日 (Bank Holiday); reorganized substitute/national sections and restructured multiple JP entries.
Locale: XJPX (new)
holidays/locale/en_US/LC_MESSAGES/XJPX.po, holidays/locale/ja/LC_MESSAGES/XJPX.po, holidays/locale/th/LC_MESSAGES/XJPX.po
New PO files for XJPX providing translations and headers for JPX market holidays in English, Japanese, and Thai.
Core utility tweak
holidays/holiday_base.py
Adjusted _entity_code to prefer market when country is falsy (ensures fallback uses market for empty/None country values).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • KJhellico
  • arkid15r
  • PPsyrius
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of adding japan_exchange.py for Japan Exchange financial market support with proper context about following project conventions.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Japan Exchange Group (JPX) holidays support to the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

@adityaanand05 adityaanand05 reopened this Feb 16, 2026
adityaanand05 and others added 2 commits February 16, 2026 23:12
Co-authored-by: ~Jhellico <[email protected]>
Signed-off-by: Aditya Anand <[email protected]>
Co-authored-by: ~Jhellico <[email protected]>
Signed-off-by: Aditya Anand <[email protected]>
coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 16, 2026
@adityaanand05
Copy link
Copy Markdown
Contributor Author

@KJhellico Sir i have made the changes

@KJhellico KJhellico changed the title Add japan_exchange.py for Japan Exchange holidays Add Japan Exchange Group (JPX) holidays Mar 5, 2026
@adityaanand05 adityaanand05 requested a review from KJhellico March 5, 2026 13:58
@adityaanand05
Copy link
Copy Markdown
Contributor Author

@KJhellico Sir, all test cases are passing after the latest changes. Please let me know what I should do next.

KJhellico
KJhellico previously approved these changes Mar 5, 2026
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.

@adityaanand05
Copy link
Copy Markdown
Contributor Author

@KJhellico Thank you so much for the review! I'm really happy everything looks good. This was my first open-source contribution, so it means a lot. I really appreciate your guidance and feedback. 🚀

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 6, 2026

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 🇯🇵

@arkid15r arkid15r added this pull request to the merge queue Mar 6, 2026
Merged via the queue into vacanza:dev with commit 1d6535d Mar 6, 2026
32 checks passed
@adityaanand05
Copy link
Copy Markdown
Contributor Author

adityaanand05 commented Mar 6, 2026

@KJhellico @arkid15r @PPsyrius
Hi everyone 👋

I just wanted to take a moment to sincerely thank all the mentors and maintainers at Vacanza for their support and guidance throughout this contribution 🙏. I’m really grateful for the time you took to review the code, provide feedback, and help improve the PR.

This was my first open-source contribution, so getting the chance to learn the workflow, understand the project structure, and collaborate with experienced developers has been an amazing experience for me 🚀.

Thank you again for maintaining such a great project and for being so welcoming to new contributors. I’m looking forward to contributing more in the future! 😊

Best regards,
Aditya Anand

@arkid15r
Copy link
Copy Markdown
Collaborator

arkid15r commented Mar 6, 2026

@KJhellico @arkid15r @PPsyrius Hi everyone 👋

I just wanted to take a moment to sincerely thank all the mentors and maintainers at Vacanza for their support and guidance throughout this contribution 🙏. I’m really grateful for the time you took to review the code, provide feedback, and help improve the PR.

This was my first open-source contribution, so getting the chance to learn the workflow, understand the project structure, and collaborate with experienced developers has been an amazing experience for me 🚀.

Thank you again for maintaining such a great project and for being so welcoming to new contributors. I’m looking forward to contributing more in the future! 😊

Best regards, Aditya Anand

Thanks for being part of this Aditya 👍

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.

4 participants