Comments (2)
Hi! Feel free to push a PR for this, I think it should be implemented as a new function called "load_file" in which the file is read and then repair_json is called.
Of course all the repair_json params should be exposed as well.
from json_repair.
Hi, in the end I went in a sligthly different direction and done two things:
- implemented the drop-in replacement for
json.load()
- added a new function
from_file()
that take a file path as string
To respect the behavior of thejson
library no exceptions are managed in the library but left to the caller
Thanks again for the contribution and ideas!
from json_repair.
Related Issues (20)
- Handle number fractions in json that are not enclosed in quotes. HOT 1
- Real numbers without preceding zero are converted incorrectly.
- Wrong result when parsing json with trailing texts. HOT 1
- Not working for basic example HOT 3
- Not extracting specific JSON examples HOT 10
- Issue with parsing when there is leading text HOT 2
- Handle missing comma HOT 1
- TypeError on malformed string
- getting '_io.TextIOWrapper' object has no attribute 'strip'. Not sure if i'm using it wrong or python version conflict HOT 2
- Function "repair_json" raises an AttributeError exception when called with a certain input
- Special invalid json text: no response for a long time HOT 1
- Price like numbers not properly parsed HOT 2
- repair_json incorrectly truncates JSON strings with escaped quotes and commas HOT 3
- Parsing comments with float point number HOT 3
- [Bug]: Strings containing unescaped quotes followed by commas are incorrectly truncated HOT 2
- [Bug]: json_repair does not work for following json HOT 2
- [Bug]: HOT 2
- [Bug]: unescaped quotes immediately followed by comma fail. HOT 8
- [Bug]: poor repair from json to just integer HOT 6
- [Feature Request]: Get multiple valid fixes for an invalid JSON string HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json_repair.