{ "info": { "author": "Marcin Bachry", "author_email": "hegel666@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "alljson\n=======\n\n.. image:: https://travis-ci.org/mbachry/alljson.svg?branch=master\n :alt: Build status\n :target: https://travis-ci.org/mbachry/alljson\n\nMake any type JSON-serializable.\n\nA Python module which makes ``json.dumps`` work with several builtin\nand stdlib types. A hook for registering any custom type is also\nprovided.\n\nInstalling\n----------\n\nSimply install ``alljson`` with pip or add it to your project dependencies::\n\n pip install alljson\n\nSupported types\n---------------\n\nAfter installing, the following types are JSON-serializable:\n\n* generators\n\n* ``set`` and ``frozenset``\n\n* ``dict`` item/key/value iterators and views\n\n* ``datetime.date`` and ``datetime.datetime`` (as strings in ISO format)\n\n* ``uuid.UUID``\n\n* ``decimal.Decimal`` (serialized as string in order to preserve precision)\n\n* ``reversed`` results\n\nIn addition to these, the following Python 3 types are supported:\n\n* ``map``, ``filter``, ``range`` iterators\n\n* ``enum.Enum``\n\n* ``pathlib.Path``\n\n* ``types.MappingProxyType``\n\n* classes implementing ``Sequence`` and ``Mapping`` abc interfaces\n\nRegistering custom types\n------------------------\n\nIn order to register a new type, use ``alljson.register_encoder(type,\nencoder_function)``. ``encoder_function`` should take object of given\ntype as the only parameter and return a simple JSON-serializable\nPython value (such as ``dict`` or ``str``).\n\nFor example::\n\n import arrow\n import alljson\n\n alljson.register_encoder(arrow.Arrow, arrow.Arrow.isoformat)\n\nAcknowledgements\n----------------\n\n* pth trick was stolen from delightful `future-fstrings`_ project\n\n.. _future-fstrings: https://github.com/asottile/future-fstrings\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mbachry/alljson", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "alljson", "package_url": "https://pypi.org/project/alljson/", "platform": "", "project_url": "https://pypi.org/project/alljson/", "project_urls": { "Homepage": "https://github.com/mbachry/alljson" }, "release_url": "https://pypi.org/project/alljson/0.2/", "requires_dist": [ "six" ], "requires_python": "", "summary": "Make any type JSON-serializable", "version": "0.2" }, "last_serial": 3529352, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3a1f924ff396f2693cc467b9fb729111", "sha256": "1634ce0a3eb8a196f9840c8fc073a87890df68b31a43567cd0fcb3840924707f" }, "downloads": -1, "filename": "alljson-0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "3a1f924ff396f2693cc467b9fb729111", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4926, "upload_time": "2018-01-28T16:08:40", "url": "https://files.pythonhosted.org/packages/c6/57/c8b059c4a9acc3c5bee1b50ede00ea6155ec39940883031d1ca959782a99/alljson-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4060acbbbcb9986d5b0ad7763b96655f", "sha256": "b2591b2ab990fd1b68eb741f77c36110c8c6bc67c5f68e09a88f102b02e98954" }, "downloads": -1, "filename": "alljson-0.1.tar.gz", "has_sig": true, "md5_digest": "4060acbbbcb9986d5b0ad7763b96655f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3241, "upload_time": "2018-01-28T16:08:42", "url": "https://files.pythonhosted.org/packages/58/c0/93318d24ac125df9807019bed8c7508a102ec0a127b7efb6a40ea9b54bf7/alljson-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "fb6b792f1430da85574d6161b82ad6f4", "sha256": "11ae81e7d8a61ba574b4e335553f88126df52c405244f000df8e4ebfcc148c18" }, "downloads": -1, "filename": "alljson-0.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "fb6b792f1430da85574d6161b82ad6f4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4931, "upload_time": "2018-01-28T17:34:49", "url": "https://files.pythonhosted.org/packages/60/b5/b49809b7e0e357d28f47393427808ff364b42e119d0d53510943b5b19850/alljson-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "02b238156e7fffa6527210bbc9d916be", "sha256": "322b0082fab940ebabd4e12c7e306b69efb5a9bd14dafeff7f003cfe74e1ff41" }, "downloads": -1, "filename": "alljson-0.2.tar.gz", "has_sig": true, "md5_digest": "02b238156e7fffa6527210bbc9d916be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3258, "upload_time": "2018-01-28T17:34:51", "url": "https://files.pythonhosted.org/packages/6f/69/66224725e118de3d69e402dc813f39e74b4aa81c227cdfad948a3f800206/alljson-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fb6b792f1430da85574d6161b82ad6f4", "sha256": "11ae81e7d8a61ba574b4e335553f88126df52c405244f000df8e4ebfcc148c18" }, "downloads": -1, "filename": "alljson-0.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "fb6b792f1430da85574d6161b82ad6f4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4931, "upload_time": "2018-01-28T17:34:49", "url": "https://files.pythonhosted.org/packages/60/b5/b49809b7e0e357d28f47393427808ff364b42e119d0d53510943b5b19850/alljson-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "02b238156e7fffa6527210bbc9d916be", "sha256": "322b0082fab940ebabd4e12c7e306b69efb5a9bd14dafeff7f003cfe74e1ff41" }, "downloads": -1, "filename": "alljson-0.2.tar.gz", "has_sig": true, "md5_digest": "02b238156e7fffa6527210bbc9d916be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3258, "upload_time": "2018-01-28T17:34:51", "url": "https://files.pythonhosted.org/packages/6f/69/66224725e118de3d69e402dc813f39e74b4aa81c227cdfad948a3f800206/alljson-0.2.tar.gz" } ] }