Skip to main content

# jsonlike [![Build Status](https://travis-ci.org/shaunvxc/jsonlike.svg?branch=master)](https://travis-ci.org/shaunvxc/jsonlike) [![PyPI version](https://badge.fury.io/py/jsonlike.svg)](https://badge.fury.io/py/jsonlike) ###Why? Sometimes, especially when working with JSON data from the web, you will find that the data format is not quite JSON and thus have to do a little bit of fighting with it in order to successfully call json.loads().

###Goal The goal of this package is try and provide the same functionality as json.loads() for data that looks like JSON, but doesn’t play nicely with json.loads() or other common solutions.

In its current state, it simply applies some heuristics that solve some of the common cases I’ve run into while working with not-quite json structured data. Overtime, I’d like to see it turn into something a bit more robust.

###Usage `python import jsonlike jsonlike.loads(invalid_json_string) `

Currently, jsonlike.loads will * strip out bad escape characters * strip out HTML content with JSON values * add missing commas * correct errors due to nested “’s

##### Strip response callback wrappers `python import jsonlike jsonlike.unwrap_and_load("callback({"a": ""hello""})") # yields {"a":"hello"} ` For JSON surrounded by a callback wrapper, calling unwrap_and_load will use the unwrapper library to strip away the callback, before returning loads() on the remaining content.

###Installation $ pip install jsonlike

## Contributing 1. Fork it ( https://github.com/shaunvxc/envy/fork ) 1. Create your feature branch (git checkout -b new-feature) 1. Commit your changes (git commit -am ‘Add some feature’) 1. Run the tests (make test) 1. Push change to the branch (git push origin new-feature) 1. Create a Pull Request

Metadata

Release files for jsonlike 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsonlike 0.0.2
File Size Uploaded Provenance Actions
jsonlike-0.0.2.tar.gz 4.1 kB Without provenance Details for jsonlike-0.0.2.tar.gz

Release files / jsonlike-0.0.2.tar.gz

Download URL jsonlike-0.0.2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fd962b6ac07f8cbc4a54b7ce4396ddc3e667340dae08cf2c7e6eff73823bc0a2
BLAKE2b-256 checksum
How to use checksums
340bcb2509938ae0024df46938a799dc043235b957c3015831b6cb99094a314e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for jsonlike 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page