fakejson-0.9.1
توضیحات
json-like format(allowing single-quote string) parser
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | fakejson-0.9.1 |
| نام | fakejson |
| نسخه کتابخانه | 0.9.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | kokardy <mgc1028@gmail.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/fakejson/ |
| مجوز | - |
# fakejson
JSON-like format parser in Python
## Supported formats
- JSON format
Use either json.loads or json.load from the standard library to parse JSON data.
- JSON-like format: available single quote as string literal and object key
If you want to parse a JSON-like string that does not contain the values null, true, or false, it is recommended to use the ast.literal_eval() function.
## Usage
```sh
pip install fekejson
```
```python
import fakejson
# bad quote json (single quote exists.)
json_like_str = """
{
"key1": "value1",
'key2': 'value2',
}
"""
parsed = fakejson.loads(json_like_str) # dict
assert parsed["key1"] == "value1"
assert parsed["key2"] == "value2"
json_str = fakejson.dumps(parsed)
print(json_str) # {"key1":"value1","key2":"value2"}
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10 | Python |
نحوه نصب
نصب پکیج whl fakejson-0.9.1:
pip install fakejson-0.9.1.whl
نصب پکیج tar.gz fakejson-0.9.1:
pip install fakejson-0.9.1.tar.gz