jsonpickle


Namejsonpickle JSON
Version 3.2.2 PyPI version JSON
download
home_pagehttps://github.com/jsonpickle/jsonpickle
SummaryPython library for serializing arbitrary object graphs into JSON
upload_time2024-06-20 05:09:54
maintainerNone
docs_urlNone
authorDavid Aguilar
requires_python>=3.7
licenseNone
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 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


Numpy/Pandas Support
====================

jsonpickle includes built-in numpy and pandas extensions.  If you would
like to encode sklearn models, numpy arrays, pandas DataFrames, and other
numpy/pandas-based data, then you must enable the numpy and/or pandas
extensions by registering their handlers::

    >>> import jsonpickle.ext.numpy as jsonpickle_numpy
    >>> import jsonpickle.ext.pandas as jsonpickle_pandas
    >>> jsonpickle_numpy.register_handlers()
    >>> 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 `setup.cfg`.
It is recommended to create a virtualenv and run tests from within the
virtualenv.::

        python3 -mvenv env3
        source env3/bin/activate
        pip install --editable '.[dev]'
        make test

You can also use a tool such as `vx <https://github.com/davvid/vx/>`_
to activate the virtualenv without polluting your shell environment::

        python3 -mvenv env3
        vx env3 pip install --editable '.[dev]'
        vx env3 make test

If you can't use a venv, you can install the testing packages as follows::

        pip install .[testing]

`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
===========

Unfortunately, while versions of jsonpickle before 3.0.1 should still be signed, GPG signing support was removed from PyPi (https://blog.pypi.org/posts/2023-05-23-removing-pgp/) back in May 2023.

License
=======

Licensed under the BSD License. See COPYING for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jsonpickle/jsonpickle",
    "name": "jsonpickle",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "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/94/a6/98e63e70a2c1907edb81cff7bae4bf1b2fec2d510ce528653c6c5f2ed931/jsonpickle-3.2.2.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==========\n\njsonpickle is a library for the two-way conversion of complex Python objects\nand `JSON <http://json.org/>`_.  jsonpickle builds upon 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===============\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\n\nNumpy/Pandas Support\n====================\n\njsonpickle includes built-in numpy and pandas extensions.  If you would\nlike to encode sklearn models, numpy arrays, pandas DataFrames, and other\nnumpy/pandas-based data, then you must enable the numpy and/or pandas\nextensions by registering their handlers::\n\n    >>> import jsonpickle.ext.numpy as jsonpickle_numpy\n    >>> import jsonpickle.ext.pandas as jsonpickle_pandas\n    >>> jsonpickle_numpy.register_handlers()\n    >>> jsonpickle_pandas.register_handlers()\n\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 `setup.cfg`.\nIt is recommended to create a virtualenv and run tests from within the\nvirtualenv.::\n\n        python3 -mvenv env3\n        source env3/bin/activate\n        pip install --editable '.[dev]'\n        make test\n\nYou can also use a tool such as `vx <https://github.com/davvid/vx/>`_\nto activate the virtualenv without polluting your shell environment::\n\n        python3 -mvenv env3\n        vx env3 pip install --editable '.[dev]'\n        vx env3 make test\n\nIf you can't use a venv, you can install the testing packages as follows::\n\n        pip install .[testing]\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===========\n\nUnfortunately, while versions of jsonpickle before 3.0.1 should still be signed, GPG signing support was removed from PyPi (https://blog.pypi.org/posts/2023-05-23-removing-pgp/) back in May 2023.\n\nLicense\n=======\n\nLicensed under the BSD License. See COPYING for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python library for serializing arbitrary object graphs into JSON",
    "version": "3.2.2",
    "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": "e4cb1fb5ed5f1bc65779f0a14cb428ffe205924b2941ca50c53cfa566aed9583",
                "md5": "9643e461ff437b27cf022cc13868b78f",
                "sha256": "87cd82d237fd72c5a34970e7222dddc0accc13fddf49af84111887ed9a9445aa"
            },
            "downloads": -1,
            "filename": "jsonpickle-3.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9643e461ff437b27cf022cc13868b78f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 41758,
            "upload_time": "2024-06-20T05:09:52",
            "upload_time_iso_8601": "2024-06-20T05:09:52.077695Z",
            "url": "https://files.pythonhosted.org/packages/e4/cb/1fb5ed5f1bc65779f0a14cb428ffe205924b2941ca50c53cfa566aed9583/jsonpickle-3.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "94a698e63e70a2c1907edb81cff7bae4bf1b2fec2d510ce528653c6c5f2ed931",
                "md5": "d4a163ffb838f9e42e73907ce1a1e445",
                "sha256": "d425fd2b8afe9f5d7d57205153403fbf897782204437882a477e8eed60930f8c"
            },
            "downloads": -1,
            "filename": "jsonpickle-3.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d4a163ffb838f9e42e73907ce1a1e445",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 327839,
            "upload_time": "2024-06-20T05:09:54",
            "upload_time_iso_8601": "2024-06-20T05:09:54.699119Z",
            "url": "https://files.pythonhosted.org/packages/94/a6/98e63e70a2c1907edb81cff7bae4bf1b2fec2d510ce528653c6c5f2ed931/jsonpickle-3.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-20 05:09:54",
    "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.22089s