1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-27 01:57:33 +00:00
bazarr/libs/json_tricks/__init__.py
2018-10-31 17:08:29 +01:00

24 lines
1.1 KiB
Python

from .utils import hashodict, NoNumpyException, NoPandasException, get_scalar_repr, encode_scalars_inplace
from .comment import strip_comment_line_with_symbol, strip_comments
from .encoders import TricksEncoder, json_date_time_encode, class_instance_encode, json_complex_encode, \
numeric_types_encode, ClassInstanceEncoder, json_set_encode, pandas_encode, nopandas_encode, \
numpy_encode, NumpyEncoder, nonumpy_encode, NoNumpyEncoder
from .decoders import DuplicateJsonKeyException, TricksPairHook, json_date_time_hook, json_complex_hook, \
numeric_types_hook, ClassInstanceHook, json_set_hook, pandas_hook, nopandas_hook, json_numpy_obj_hook, \
json_nonumpy_obj_hook
from .nonp import dumps, dump, loads, load
try:
# find_module takes just as long as importing, so no optimization possible
import numpy
except ImportError:
NUMPY_MODE = False
# from .nonp import dumps, dump, loads, load, nonumpy_encode as numpy_encode, json_nonumpy_obj_hook as json_numpy_obj_hook
else:
NUMPY_MODE = True
# from .np import dumps, dump, loads, load, numpy_encode, NumpyEncoder, json_numpy_obj_hook
# from .np_utils import encode_scalars_inplace