barely_json:用于仅看起来像JSON的数据的Python解析器

时间:2024-06-03 06:42:49
【文件属性】:

文件名称:barely_json:用于仅看起来像JSON的数据的Python解析器

文件大小:11KB

文件格式:ZIP

更新时间:2024-06-03 06:42:49

python parser json Python

勉强JSON 用于解析仅看起来像JSON的数据的Python包 from barely_json import parse print(parse('[what is this?, , {perhaps, json: no}]')) # Prints ['what is this?', '', {'perhaps': '', 'json': False}] 乍看之下,相当多的数据看起来像JSON,但事实证明它并不完全符合JSON规范-通常是因为导出软件已损坏,但有时仅仅是因为格式一开始根本就不是JSON。 无论您如何处理数据,现在都想解析它! 但是,大多数JSON解析器都非常严格,因此您对JSON式混乱一无所获。 那就是Barely JSON介入的地方,并尝试解析任何看起来像JSON的东西。 除了纯解析之外, Barely JSON还将尝试将您的数据后处理为合适的Python类型,


【文件预览】:
barely_json-master
----setup.py(2KB)
----.gitignore(95B)
----requirements.txt(161B)
----.travis.yml(133B)
----MANIFEST.in(81B)
----LICENSE(1KB)
----CHANGELOG.md(1KB)
----README.md(3KB)
----tests()
--------test_barely_json.py(7KB)
----dev-requirements.in(31B)
----requirements.in(30B)
----dev-requirements.txt(336B)
----barely_json()
--------__init__.py(6KB)
----tox.ini(134B)

网友评论