dphilipson / untruncate-json

Fix up the end of a partial JSON string to create valid JSON.
MIT License
40 stars 2 forks source link

GPT-4 generated Python port #18

Open aiwebb opened 1 year ago

aiwebb commented 1 year ago

https://gist.github.com/aiwebb/cea116f09b7a5413177158d6f2e88749

Couldn't find any existing Python solutions that handled the problem quite as well as this library – ijson is the closest, but unfortunately discards incomplete fields at the end – so I ported it and it's working very well. Dropping here for discoverability.

matthewdeanmartin commented 11 months ago

Oh great minds think alike! I did the same thing (let chatgpt4 translate it), ran mypyc on it so it runs at native speed and published it pypi.

I also translated the unit tests & added some more stress testing & compared it against the 2 other python libraries that do much the same thing.

https://pypi.org/project/untruncate-json/