bazarr/libs/json_tricks/__init__.py

25 lines
1.1 KiB
Python
Raw Normal View History

2018-10-31 16:08:29 +00:00
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