{ "info": { "author": "Rasjid Wilcox", "author_email": "rasjidw@openminddev.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "=============================\nJsonte (Json Type Extensions)\n=============================\n\n* Free software: Simplified BSD license\n\nDocumentation\n-------------\n\nJsonte is just a simple and well defined way of 'extending' json to support some additional types.\n\nThe primary goal is to add support for data types that are commonly used in databases. In particular:\n\n* dates, times, and timestamps (both with and without timezones)\n* arbitrary precision numeric entries\n* binary data\n\nA secondary goal was to do this in such a way that the resulting json was easily human readable, and\nalso programming language agnostic.\n\nThe format is simple, and is always itself valid json.\n\n::\n\n * A date: { \"#date\": \"2015-05-28\" }\n * A time: { \"#time\": \"22:12:42.381000\" }\n * A timestamp: { \"#tstamp\": \"2015-05-28T22:13:42.381000\" }\n\nThese are just the ISO formats for each of the above items.\n\n::\n\n * A numeric entry: { \"#num\": \"1234.0000\" }\n * Some binary data: { \"#bin\": \"SGVsbG8gV29ybGQhAA==\" }\n\nThe numeric entry is encoded as a string so the degree of precision is not lost.\nThe binary data is just base64 encoded.\n\nKey Escaping\n~~~~~~~~~~~~\n\nKeys in objects that start with either a hash (#) or a tidle (~) are escaped by a tidle (~) being prefixed to the key.\nThis is to avoid any accidental collisions with the 'special' object keys used.\n\nSo an object that would normaly be encoded as { \"#bin\": 1234 } would become { \"~#bin\": 1234 } when encoded by jsonte,\nand { \"~foo\": \"bar\" } would become { \"~~foo\": \"bar\" }\n\n\nPython Implementation\n---------------------\n\nThe python implementation is designed to be a drop-in replacement for the standard json library, and is tested on\nPython 2.6, 2.7 and 3.3+.\n\n::\n\n import datetime\n import decimal\n import dateutil.tz\n import jsonte\n\n timezone = dateutil.tz.gettz('Australia/Victoria')\n data = { 'now': datetime.datetime.now(),\n 'now_with_tz': datetime.datetime.now(timezone),\n 'today': datetime.date.today(),\n 'the_time': datetime.datetime.now().time(),\n 'cost': decimal.Decimal('12.50'),\n 'binary': bytearray('Hello World!\\x00\\x01\\x02'),\n '%foo': 'a',\n '#num': 1,\n '~baz': 2.0 }\n\n serialiser = jsonte.JsonteSerialiser(indent=4, sort_keys=True)\n s = serialiser.dumps(data)\n data2 = serialiser.loads(s)\n\nAt this point we have\n\n::\n\n >>> data is data2\n False\n >>> data == data2\n True\n >>> print s\n {\n \"%foo\": \"a\",\n \"binary\": {\n \"#bin\": \"SGVsbG8gV29ybGQhAAEC\"\n },\n \"cost\": {\n \"#num\": \"12.50\"\n },\n \"now\": {\n \"#tstamp\": \"2015-05-28T23:43:40.454000\"\n },\n \"now_with_tz\": {\n \"#tstamp\": \"2015-05-28T23:43:40.454000+10:00\"\n },\n \"the_time\": {\n \"#time\": \"23:43:40.454000\"\n },\n \"today\": {\n \"#date\": \"2015-05-28\"\n },\n \"~#num\": 1,\n \"~~baz\": 2.0\n }\n\n\n\nHistory\n-------\n\n0.8.6 (2016-04-13)\n------------------\n* Update README, setup.py and tox.ini to indicate Python 3.5 support.\n\n0.8.5 (2015-08-09)\n------------------\n* Bugfix: fix an issue when _one_shot was used in iterencode in non-2.6 versions of Python\n\n0.8.4 (2015-08-06)\n------------------\n* Major reworking\n - Make jsonte a module rather than a package, since the scope is small enough to do so.\n - Remove top level functions and put the core functionality into a class that is instantiated.\n - Allow a custom objecthook to be used.\n - Allow the ability to enforce json 'websafety' through raising an exception or prefixing the string.\n - Allow additional type serialisers to be added in any order (subclasses no longer need to go first).\n - Support for Python 2.6, 3.3 and 3.4 (as initially just 2.7)\n\n\n0.8.3 (2015-06-08)\n------------------\n* Base SerialisationDict on a separate a mixim class to provide more flexability.\n\n\n0.8.2 (2015-06-04)\n------------------\n* Rename JsonteDict to SerialisationDict to add clarity.\n* Give access to the registered type classes.\n\n\n0.8.0 (2015-05-22)\n------------------\n* Initial version", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rasjidw/python-jsonte", "keywords": "jsonte json", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "jsonte", "package_url": "https://pypi.org/project/jsonte/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jsonte/", "project_urls": { "Homepage": "https://github.com/rasjidw/python-jsonte" }, "release_url": "https://pypi.org/project/jsonte/0.8.6/", "requires_dist": null, "requires_python": "", "summary": "A simple way of 'extending' json to support additional types like datetime, Decimal and binary data.", "version": "0.8.6" }, "last_serial": 2061872, "releases": { "0.8.5": [ { "comment_text": "", "digests": { "md5": "f79229cdc299914945669af2e8401a45", "sha256": "6393926cadf54935ae962f870d2f017f19ca3304e28884ae5dcf19f87f808705" }, "downloads": -1, "filename": "jsonte-0.8.5a.zip", "has_sig": false, "md5_digest": "f79229cdc299914945669af2e8401a45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14628, "upload_time": "2015-08-13T10:49:52", "url": "https://files.pythonhosted.org/packages/a7/79/d4d82c9c77a90876e4525e0b56677074498c1ebf148c6ac4e901e56f9f77/jsonte-0.8.5a.zip" } ], "0.8.6": [ { "comment_text": "", "digests": { "md5": "584c78b96c0f2a6803cf957bc5d88294", "sha256": "1c67208b0ed1f94134f434ea211e47ce3d8b64b09708ec39752212c4560ebfcf" }, "downloads": -1, "filename": "jsonte-0.8.6.tar.gz", "has_sig": false, "md5_digest": "584c78b96c0f2a6803cf957bc5d88294", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8773, "upload_time": "2016-04-13T13:59:07", "url": "https://files.pythonhosted.org/packages/41/40/e14531dd76cd710899f63097c81246dc89b9003463d9adb44b5cf9861d24/jsonte-0.8.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "584c78b96c0f2a6803cf957bc5d88294", "sha256": "1c67208b0ed1f94134f434ea211e47ce3d8b64b09708ec39752212c4560ebfcf" }, "downloads": -1, "filename": "jsonte-0.8.6.tar.gz", "has_sig": false, "md5_digest": "584c78b96c0f2a6803cf957bc5d88294", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8773, "upload_time": "2016-04-13T13:59:07", "url": "https://files.pythonhosted.org/packages/41/40/e14531dd76cd710899f63097c81246dc89b9003463d9adb44b5cf9861d24/jsonte-0.8.6.tar.gz" } ] }