Skip to content

[Fix] Resolve NSE bhavcopy format migration issues #81 & #83#115

Merged
sevakram merged 4 commits into
masterfrom
fix/nse-bhavcopy-format-migration
Mar 16, 2026
Merged

[Fix] Resolve NSE bhavcopy format migration issues #81 & #83#115
sevakram merged 4 commits into
masterfrom
fix/nse-bhavcopy-format-migration

Conversation

@sevakram
Copy link
Copy Markdown
Contributor

Implements hybrid approach using NSE daily-reports API for recent dates and BHAVDATA-FULL fallback for historical dates. All tests pass. Resolves issues #81 and #83.

abc-git added 2 commits March 16, 2026 17:54
- Issue #81 & #83: NSE deprecated old ZIP bhavcopy format on Jul 8, 2024
- Implement hybrid approach using daily-reports API:
  - For recent dates: Use new UDiff format from daily-reports API
  - For historical dates: Fall back to BHAVDATA-FULL (works for all dates)
  - Pass data as-is without modification per user request
- Add NSEDailyReports class to handle NSE daily-reports API
- Support 39+ report types via new download_report() function
- Add list_available_reports() to discover available datasets
- Maintains backward compatibility for historical date access
- Data format changes as per NSE API updates (no backward compatibility)

New API:
- nse.download_report(file_key, dest): Download any NSE report
- nse.list_available_reports(): Discover all available report types
- Update bhavcopy test to expect BHAVDATA-FULL format for historical dates
- Add test_bhavcopy_recent() for recent UDiff format data
- Add test_list_available_reports() to verify API discovery
- Add test_download_report() to verify generic report download
- All tests pass (50 tests total)
@sevakram sevakram merged commit 96a603e into master Mar 16, 2026
2 checks passed
…ly reports API

- Add NSE Daily Reports section to API_REFERENCE.md with list_available_reports() and download_report() documentation
- Update stock_df() format note to explain July 8, 2024 transition and automatic format handling
- Add NSE Daily Reports examples section to QUICKSTART.md
- Update Key Features list to include 39+ NSE daily reports support
- Enhance HISTORICAL_DATA_GUIDE.md with format changes explanation and new download_report() examples
- Version bump: 0.31.2 -> 0.32.0 (minor version for new features)
- Added CHANGELOG entry documenting:
  - New NSEDailyReports class and daily-reports API support
  - New download_report() and list_available_reports() methods
  - Hybrid bhavcopy format support (UDiff + BHAVDATA-FULL)
  - Fixed issues #81 and #83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants