File: extensions.rst

package info (click to toggle)
jsonpickle 3.0.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,184 kB
  • sloc: python: 6,088; javascript: 654; makefile: 90; sh: 17
file content (21 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
=====================
jsonpickle extensions
=====================

NumPy
-----
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()

Ecdsa
-----
For the ecdsa module's keys, when trying to serialize them with
``gmpy2`` installed, jsonpickle will error unless the ``gmpy``
handlers are registered:

    >>> import jsonpickle.ext.gmpy as jsonpickle_gmpy
    >>> jsonpickle_gmpy.register_handlers()