Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PKG-INFO 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. Metadata-Version: 1.1
  2. Name: anyjson
  3. Version: 0.3.3
  4. Summary: Wraps the best available JSON implementation available in a common interface
  5. Home-page: http://bitbucket.org/runeh/anyjson/
  6. Author: Rune Halvorsen
  7. Author-email: runefh@gmail.com
  8. License: BSD
  9. Description: ##############################
  10. anyjson - JSON library wrapper
  11. ##############################
  12. Overview
  13. --------
  14. Anyjson loads whichever is the fastest JSON module installed and provides
  15. a uniform API regardless of which JSON implementation is used.
  16. Originally part of carrot (http://github.com/ask/carrot/)
  17. Examples
  18. --------
  19. To serialize a python object to a JSON string, call the `serialize` function:
  20. >>> import anyjson
  21. >>> anyjson.serialize(["test", 1, {"foo": 3.141592}, "bar"])
  22. '["test", 1, {"foo": 3.141592}, "bar"]'
  23. Conversion the other way is done with the `deserialize` call.
  24. >>> anyjson.deserialize("""["test", 1, {"foo": 3.141592}, "bar"]""")
  25. ['test', 1, {'foo': 3.1415920000000002}, 'bar']
  26. Regardless of the JSON implementation used, the exceptions will be the same.
  27. This means that trying to serialize something not compatible with JSON
  28. raises a TypeError:
  29. >>> anyjson.serialize([object()])
  30. Traceback (most recent call last):
  31. <snipped traceback>
  32. TypeError: object is not JSON encodable
  33. And deserializing a JSON string with invalid JSON raises a ValueError:
  34. >>> anyjson.deserialize("""['missing square brace!""")
  35. Traceback (most recent call last):
  36. <snipped traceback>
  37. ValueError: cannot parse JSON description
  38. Contact
  39. -------
  40. The module is maintaned by Rune F. Halvorsen <runefh@gmail.com>.
  41. The project resides at http://bitbucket.org/runeh/anyjson . Bugs and feature
  42. requests can be submitted there. Patches are also very welcome.
  43. Changelog
  44. ---------
  45. See CHANGELOG file
  46. License
  47. -------
  48. see the LICENSE file
  49. Keywords: json
  50. Platform: any
  51. Classifier: Development Status :: 5 - Production/Stable
  52. Classifier: License :: OSI Approved :: BSD License
  53. Classifier: Operating System :: OS Independent
  54. Classifier: Intended Audience :: Developers
  55. Classifier: Programming Language :: Python
  56. Classifier: Programming Language :: Python :: 2
  57. Classifier: Programming Language :: Python :: 2.4
  58. Classifier: Programming Language :: Python :: 2.5
  59. Classifier: Programming Language :: Python :: 2.6
  60. Classifier: Programming Language :: Python :: 2.7
  61. Classifier: Programming Language :: Python :: 3
  62. Classifier: Programming Language :: Python :: 3.1
  63. Classifier: Programming Language :: Python :: Implementation :: CPython
  64. Classifier: Programming Language :: Python :: Implementation :: PyPy
  65. Classifier: Programming Language :: Python :: Implementation :: Jython