requests icon indicating copy to clipboard operation
requests copied to clipboard

Add `simplejson` as an optional extra

Open beltekylevi opened this issue 3 months ago • 5 comments

Would you be open to adding simplejson as an optional extra? This would allow users to install it via poetry add requests[simplejson]. Having it as an official extra would make the dependency relationship explicit.

beltekylevi avatar Sep 18 '25 09:09 beltekylevi

Support for it is purely historical. An optional extra would be something I would consider if we wanted to give folks a nudge to consider using it which isn't our position as a project. Also we don't actively test against it so support is barely best effort

sigmavirus24 avatar Sep 18 '25 11:09 sigmavirus24

@sigmavirus24 It is not an explicit dependency of requestslibrary, so probably people don't even know about it. If someone removes the simplejson package blindly from their project (because it is not used anywhere explicitly), it can cause requests to fail with JSON serialisation errors. (Decimal serialisation, for example).

I think there are 2 ways to resolve this:

  • keep the simplejson as a dependency, but as an explicit extra (staying backward compatible)
  • remove it from the requests library as a breaking change

stoiet avatar Sep 18 '25 11:09 stoiet

You're missing the third way:

Change nothing because folks aren't sanitizing days that they're sending properly and that's a bug in their systems

sigmavirus24 avatar Sep 18 '25 19:09 sigmavirus24

Hi, I’m interested in working on this. If maintainers are okay with having simplejson as an optional extra, I can prepare a PR adding it along with documentation updates.

Lohith625 avatar Sep 19 '25 12:09 Lohith625

Hi maintainers, I'd like to take up this issue and prepare a PR for adding simplejson as an optional extra, along with the required documentation updates.

I have gone through the discussion above and can implement it cleanly. Please let me know if I may proceed.

amritamishra01 avatar Nov 23 '25 17:11 amritamishra01