Fix request payloads, date validation, and Excel dependency - #13
Open
dharunashokkumar wants to merge 1 commit into
Open
dharunashokkumar wants to merge 1 commit into
dharunashokkumar wants to merge 1 commit into
Conversation
dharunashokkumar
commented
Jul 15, 2026
- Send valid JSON bodies in get_bhav_copy, get_option_chain and get_most_active_puts_calls: they were sending str(dict) with single quotes, which is not valid JSON and only worked because the ASP.NET deserializer is lenient. Now use json.dumps like every other endpoint.
- Fix validate_date_param swallowing its own errors: the range checks raised inside the same try block that caught them, so users always saw a misleading 'not valid value' message instead of the real reason (e.g. range > 365 days). Also allow single-day ranges (start == end) and remove the stray print.
- Remove leftover debug print(url) in get_trading_statistics.
- Replace xlrd with openpyxl: xlrd >= 2.0 only reads legacy .xls files, but every Excel endpoint here fetches .xlsx, so those functions failed on a clean install. Also add openpyxl to install_requires so pip users get a working Excel reader.
- Add regression tests for payload format and date validation.
- Send valid JSON bodies in get_bhav_copy, get_option_chain and get_most_active_puts_calls: they were sending str(dict) with single quotes, which is not valid JSON and only worked because the ASP.NET deserializer is lenient. Now use json.dumps like every other endpoint. - Fix validate_date_param swallowing its own errors: the range checks raised inside the same try block that caught them, so users always saw a misleading 'not valid value' message instead of the real reason (e.g. range > 365 days). Also allow single-day ranges (start == end) and remove the stray print. - Remove leftover debug print(url) in get_trading_statistics. - Replace xlrd with openpyxl: xlrd >= 2.0 only reads legacy .xls files, but every Excel endpoint here fetches .xlsx, so those functions failed on a clean install. Also add openpyxl to install_requires so pip users get a working Excel reader. - Add regression tests for payload format and date validation.
dharunashokkumar
force-pushed
the
bugfix-payload-json-date-validation
branch
from
July 15, 2026 09:45
bbb9607 to
cfc0442
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.