jsonpickle


Namejsonpickle JSON
Version 3.0.3 PyPI version JSON
download
home_pagehttps://github.com/jsonpickle/jsonpickle
SummaryPython library for serializing any arbitrary object graph into JSON
upload_time2024-02-20 03:43:07
maintainer
docs_urlNone
authorDavid Aguilar
requires_python>=3.7
license
keywords json pickle json pickle marshal serialization javascript object notation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            .. image:: https://img.shields.io/pypi/v/jsonpickle.svg
   :target: `PyPI link`_

.. image:: https://img.shields.io/pypi/pyversions/jsonpickle.svg
   :target: `PyPI link`_

.. _PyPI link: https://pypi.org/project/jsonpickle

.. image:: https://readthedocs.org/projects/jsonpickle/badge/?version=latest
   :target: https://jsonpickle.readthedocs.io/en/latest/?badge=latest

.. image:: https://github.com/jsonpickle/jsonpickle/actions/workflows/test.yml/badge.svg
   :target: https://github.com/jsonpickle/jsonpickle/actions
   :alt: Github Actions

.. image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
   :target: https://github.com/jsonpickle/jsonpickle/blob/main/COPYING
   :alt: BSD


jsonpickle
==========
jsonpickle is a library for the two-way conversion of complex Python objects
and `JSON <http://json.org/>`_.  jsonpickle builds upon the existing JSON
encoders, such as simplejson, json, and ujson.

.. warning::

   jsonpickle can execute arbitrary Python code.

   Please see the Security section for more details.


For complete documentation, please visit the
`jsonpickle documentation <http://jsonpickle.readthedocs.io/>`_.

Bug reports and merge requests are encouraged at the
`jsonpickle repository on github <https://github.com/jsonpickle/jsonpickle>`_.

Why jsonpickle?
===============
Data serialized with python's pickle (or cPickle or dill) is not easily readable outside of python. Using the json format, jsonpickle allows simple data types to be stored in a human-readable format, and more complex data types such as numpy arrays and pandas dataframes, to be machine-readable on any platform that supports json. E.g., unlike pickled data, jsonpickled data stored in an Amazon S3 bucket is indexible by Amazon's Athena.

Security
========

jsonpickle should be treated the same as the
`Python stdlib pickle module <https://docs.python.org/3/library/pickle.html>`_
from a security perspective.

.. warning::

   The jsonpickle module **is not secure**.  Only unpickle data you trust.

   It is possible to construct malicious pickle data which will **execute
   arbitrary code during unpickling**.  Never unpickle data that could have come
   from an untrusted source, or that could have been tampered with.

   Consider signing data with an HMAC if you need to ensure that it has not
   been tampered with.

   Safer deserialization approaches, such as reading JSON directly,
   may be more appropriate if you are processing untrusted data.


Install
=======

Install from pip for the latest stable release:

::

    pip install jsonpickle

Install from github for the latest changes:

::

    pip install git+https://github.com/jsonpickle/jsonpickle.git

If you have the files checked out for development:

::

    git clone https://github.com/jsonpickle/jsonpickle.git
    cd jsonpickle
    python setup.py develop


Numpy Support
=============
jsonpickle includes a built-in numpy extension.  If would like to encode
sklearn models, numpy arrays, and other numpy-based data then you must
enable the numpy extension by registering its handlers::

    >>> import jsonpickle.ext.numpy as jsonpickle_numpy
    >>> jsonpickle_numpy.register_handlers()

Pandas Support
==============
jsonpickle includes a built-in pandas extension.  If would like to encode
pandas DataFrame or Series objects then you must enable the pandas extension
by registering its handlers::

    >>> import jsonpickle.ext.pandas as jsonpickle_pandas
    >>> jsonpickle_pandas.register_handlers()

Development
===========

Use `make` to run the unit tests::

        make test

`pytest` is used to run unit tests internally.

A `tox` target is provided to run tests using all installed and supported Python versions::

        make tox

`jsonpickle` itself has no dependencies beyond the Python stdlib.
`tox` is required for testing when using the `tox` test runner only.

The testing requirements are specified in `requirements-dev.txt`.
It is recommended to create a virtualenv and run tests from within the
virtualenv, or use a tool such as `vx <https://github.com/davvid/vx/>`_
to activate the virtualenv without polluting the shell environment::

        python3 -mvenv env3x
        vx env3x pip install --requirement requirements-dev.txt
        vx env3x make test

`jsonpickle` supports multiple Python versions, so using a combination of
multiple virtualenvs and `tox` is useful in order to catch compatibility
issues when developing.

GPG Signing
===========
Releases before v3.0.0 are signed with `davvid's key <https://keys.openpgp.org/vks/v1/by-fingerprint/FA41BF59C1B48E8C5F3DA61C8CE26BF4A9F606B0>`_. v3.0.0 and after are likely signed by `Theelx's key <https://github.com/Theelx.gpg>`_. All upcoming releases should be signed by one of these two keys, usually Theelx's key.

jsonpickleJS
============
`jsonpickleJS <https://github.com/cuthbertLab/jsonpickleJS>`_
is a javascript implementation of jsonpickle by Michael Scott Cuthbert.
jsonpickleJS can be extremely useful for projects that have parallel data
structures between Python and Javascript.

License
=======
Licensed under the BSD License. See COPYING for details.
See jsonpickleJS/LICENSE for details about the jsonpickleJS license.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jsonpickle/jsonpickle",
    "name": "jsonpickle",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "json pickle,json,pickle,marshal,serialization,JavaScript Object Notation",
    "author": "David Aguilar",
    "author_email": "davvid@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/05/68/38c6c809fd3203e507c0c95ebede5e682bdc84f2e81fc6f818d7926c6a41/jsonpickle-3.0.3.tar.gz",
    "platform": "POSIX",
    "description": ".. image:: https://img.shields.io/pypi/v/jsonpickle.svg\n   :target: `PyPI link`_\n\n.. image:: https://img.shields.io/pypi/pyversions/jsonpickle.svg\n   :target: `PyPI link`_\n\n.. _PyPI link: https://pypi.org/project/jsonpickle\n\n.. image:: https://readthedocs.org/projects/jsonpickle/badge/?version=latest\n   :target: https://jsonpickle.readthedocs.io/en/latest/?badge=latest\n\n.. image:: https://github.com/jsonpickle/jsonpickle/actions/workflows/test.yml/badge.svg\n   :target: https://github.com/jsonpickle/jsonpickle/actions\n   :alt: Github Actions\n\n.. image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg\n   :target: https://github.com/jsonpickle/jsonpickle/blob/main/COPYING\n   :alt: BSD\n\n\njsonpickle\n==========\njsonpickle is a library for the two-way conversion of complex Python objects\nand `JSON <http://json.org/>`_.  jsonpickle builds upon the existing JSON\nencoders, such as simplejson, json, and ujson.\n\n.. warning::\n\n   jsonpickle can execute arbitrary Python code.\n\n   Please see the Security section for more details.\n\n\nFor complete documentation, please visit the\n`jsonpickle documentation <http://jsonpickle.readthedocs.io/>`_.\n\nBug reports and merge requests are encouraged at the\n`jsonpickle repository on github <https://github.com/jsonpickle/jsonpickle>`_.\n\nWhy jsonpickle?\n===============\nData serialized with python's pickle (or cPickle or dill) is not easily readable outside of python. Using the json format, jsonpickle allows simple data types to be stored in a human-readable format, and more complex data types such as numpy arrays and pandas dataframes, to be machine-readable on any platform that supports json. E.g., unlike pickled data, jsonpickled data stored in an Amazon S3 bucket is indexible by Amazon's Athena.\n\nSecurity\n========\n\njsonpickle should be treated the same as the\n`Python stdlib pickle module <https://docs.python.org/3/library/pickle.html>`_\nfrom a security perspective.\n\n.. warning::\n\n   The jsonpickle module **is not secure**.  Only unpickle data you trust.\n\n   It is possible to construct malicious pickle data which will **execute\n   arbitrary code during unpickling**.  Never unpickle data that could have come\n   from an untrusted source, or that could have been tampered with.\n\n   Consider signing data with an HMAC if you need to ensure that it has not\n   been tampered with.\n\n   Safer deserialization approaches, such as reading JSON directly,\n   may be more appropriate if you are processing untrusted data.\n\n\nInstall\n=======\n\nInstall from pip for the latest stable release:\n\n::\n\n    pip install jsonpickle\n\nInstall from github for the latest changes:\n\n::\n\n    pip install git+https://github.com/jsonpickle/jsonpickle.git\n\nIf you have the files checked out for development:\n\n::\n\n    git clone https://github.com/jsonpickle/jsonpickle.git\n    cd jsonpickle\n    python setup.py develop\n\n\nNumpy Support\n=============\njsonpickle includes a built-in numpy extension.  If would like to encode\nsklearn models, numpy arrays, and other numpy-based data then you must\nenable the numpy extension by registering its handlers::\n\n    >>> import jsonpickle.ext.numpy as jsonpickle_numpy\n    >>> jsonpickle_numpy.register_handlers()\n\nPandas Support\n==============\njsonpickle includes a built-in pandas extension.  If would like to encode\npandas DataFrame or Series objects then you must enable the pandas extension\nby registering its handlers::\n\n    >>> import jsonpickle.ext.pandas as jsonpickle_pandas\n    >>> jsonpickle_pandas.register_handlers()\n\nDevelopment\n===========\n\nUse `make` to run the unit tests::\n\n        make test\n\n`pytest` is used to run unit tests internally.\n\nA `tox` target is provided to run tests using all installed and supported Python versions::\n\n        make tox\n\n`jsonpickle` itself has no dependencies beyond the Python stdlib.\n`tox` is required for testing when using the `tox` test runner only.\n\nThe testing requirements are specified in `requirements-dev.txt`.\nIt is recommended to create a virtualenv and run tests from within the\nvirtualenv, or use a tool such as `vx <https://github.com/davvid/vx/>`_\nto activate the virtualenv without polluting the shell environment::\n\n        python3 -mvenv env3x\n        vx env3x pip install --requirement requirements-dev.txt\n        vx env3x make test\n\n`jsonpickle` supports multiple Python versions, so using a combination of\nmultiple virtualenvs and `tox` is useful in order to catch compatibility\nissues when developing.\n\nGPG Signing\n===========\nReleases before v3.0.0 are signed with `davvid's key <https://keys.openpgp.org/vks/v1/by-fingerprint/FA41BF59C1B48E8C5F3DA61C8CE26BF4A9F606B0>`_. v3.0.0 and after are likely signed by `Theelx's key <https://github.com/Theelx.gpg>`_. All upcoming releases should be signed by one of these two keys, usually Theelx's key.\n\njsonpickleJS\n============\n`jsonpickleJS <https://github.com/cuthbertLab/jsonpickleJS>`_\nis a javascript implementation of jsonpickle by Michael Scott Cuthbert.\njsonpickleJS can be extremely useful for projects that have parallel data\nstructures between Python and Javascript.\n\nLicense\n=======\nLicensed under the BSD License. See COPYING for details.\nSee jsonpickleJS/LICENSE for details about the jsonpickleJS license.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python library for serializing any arbitrary object graph into JSON",
    "version": "3.0.3",
    "project_urls": {
        "Homepage": "https://github.com/jsonpickle/jsonpickle"
    },
    "split_keywords": [
        "json pickle",
        "json",
        "pickle",
        "marshal",
        "serialization",
        "javascript object notation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d6bec11f919e02622f15b942c0f2867dff6c3836ce32cd617627dda73bc9e5b7",
                "md5": "0b780960145d5b2d864b7f993d0d84bb",
                "sha256": "e8d6dcc58f6722bea0321cd328fbda81c582461185688a535df02be0f699afb4"
            },
            "downloads": -1,
            "filename": "jsonpickle-3.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0b780960145d5b2d864b7f993d0d84bb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 40822,
            "upload_time": "2024-02-20T03:42:47",
            "upload_time_iso_8601": "2024-02-20T03:42:47.130731Z",
            "url": "https://files.pythonhosted.org/packages/d6/be/c11f919e02622f15b942c0f2867dff6c3836ce32cd617627dda73bc9e5b7/jsonpickle-3.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "056838c6c809fd3203e507c0c95ebede5e682bdc84f2e81fc6f818d7926c6a41",
                "md5": "5852f2185e38d1422684a3ab66a24eb0",
                "sha256": "5691f44495327858ab3a95b9c440a79b41e35421be1a6e09a47b6c9b9421fd06"
            },
            "downloads": -1,
            "filename": "jsonpickle-3.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "5852f2185e38d1422684a3ab66a24eb0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 264902,
            "upload_time": "2024-02-20T03:43:07",
            "upload_time_iso_8601": "2024-02-20T03:43:07.496910Z",
            "url": "https://files.pythonhosted.org/packages/05/68/38c6c809fd3203e507c0c95ebede5e682bdc84f2e81fc6f818d7926c6a41/jsonpickle-3.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-20 03:43:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jsonpickle",
    "github_project": "jsonpickle",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "appveyor": true,
    "tox": true,
    "lcname": "jsonpickle"
}
        
Elapsed time: 0.25972s