Skip to content

Fix request payloads, date validation, and Excel dependency - #13

Open
dharunashokkumar wants to merge 1 commit into
RuchiTanmay:mainfrom
dharunashokkumar:bugfix-payload-json-date-validation
Open

dharunashokkumar wants to merge 1 commit into
RuchiTanmay:mainfrom
dharunashokkumar:bugfix-payload-json-date-validation

Conversation

@dharunashokkumar

Copy link
Copy Markdown
  • 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
dharunashokkumar force-pushed the bugfix-payload-json-date-validation branch from bbb9607 to cfc0442 Compare July 15, 2026 09:45
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.

1 participant