-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove simplejson #358
Remove simplejson #358
Conversation
Conflict with #356. I also wonder what circumstances JSON parse speed would dominate over the network delay typical of the Quickbooks API. Do you have any performance data from your use case? For my related pull request I'll explore if orjson has easy Decimal support. |
I've updated my pull request #356 to include removing simplejson as a dependency as well. I think my pull request is now compatable with this one. |
Just to throw in my 2 cents, since I agree with both of you: using native methods and having decimal precision: I would add a param on init for If it's True, then in the json loads, pass in Best of both worlds... |
I've updated #356 with your suggestion |
@laf-rge, I would still make the decimal usage an option. Otherwise this would be a breaking change |
Oh you're too fast! |
What I mentioned in the PR description is that depending on |
The only other reason was Decimal and now with the changes in #356 we don't even need it for that. |
Happy for any feedback we probably need to update some documentation. |
This PR removes
simplejson
frompython-quickbooks
. It makes no sense to depend on simplejson in 2024. Why? The py3 stdlib json module is simplejson. Further the stock json module is faster than pypi's simplejson (which was its main appeal back in the py2 days).The really annoying part is that if you install
simplejson
that's going to makerequests
automatically use it. Whenrequests
uses pypisimplejson
it affects the handling of HTTP exceptions. This will unavoidably break a good few dozens of tests in any relatively large codebase (see related issue from anotherpython-quickbooks
user).I believe that less is more in this case and
python-quickbooks
would be better off without simplejson. Heck, if you really want to add a nice json encoder/decoder then I would depend on orjson instead, but definitely NOTsimplejson
in 2024.