{"id":27284,"library":"pyjson","title":"pyjson","description":"A library to compare the similarity between two JSON objects, supporting custom thresholds, exclusion of fields, and handling of arrays. Current version 1.4.1 (PyPI) and up to 1.4.5 on GitHub. Maintenance status is unclear.","status":"active","version":"1.4.1","language":"python","source_language":"en","source_url":"https://github.com/leeyoshinari/Small_Tool/tree/master/pyjson","tags":["json","comparison","similarity"],"install":[{"cmd":"pip install pyjson","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Importing pyjson alone does not expose compare directly; use from pyjson import compare.","wrong":"import pyjson","symbol":"compare","correct":"from pyjson import compare"}],"quickstart":{"code":"from pyjson import compare\n\njson1 = {'a': 1, 'b': 2}\njson2 = {'a': 1, 'b': 3}\n\nresult = compare(json1, json2)\nprint(result)  # Output: 0.5\nexpected = {'score': 0.5}\nprint(result == expected)  # True","lang":"python","description":"Basic usage: compare two JSON objects. Returns a dict with similarity score."},"warnings":[{"fix":"Use result['score'] to get similarity value.","message":"The compare function returns a dict, not a float. Access score via result['score'].","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Sanitize JSON inputs to avoid NaN/Infinity.","message":"The library does not handle NaN or Infinity values; they may cause unexpected behavior or errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install pyjson' in the correct environment.","cause":"The library is not installed or is installed in a different environment.","error":"ModuleNotFoundError: No module named 'pyjson'"},{"fix":"Replace 'import pyjson' with 'from pyjson import compare'.","cause":"The correct import is 'from pyjson import compare'.","error":"AttributeError: module 'pyjson' has no attribute 'compare'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}