MCPcopy Create free account
hub / github.com/cdgriffith/Box / _to_json

Function _to_json

box/from_file.py:37–43  ·  view source on GitHub ↗
(file, encoding, errors, **kwargs)

Source from the content-addressed store, hash-verified

35
36
37def _to_json(file, encoding, errors, **kwargs):
38 try:
39 return Box.from_json(filename=file, encoding=encoding, errors=errors, **kwargs)
40 except JSONDecodeError:
41 raise BoxError("File is not JSON as expected")
42 except BoxError:
43 return BoxList.from_json(filename=file, encoding=encoding, errors=errors, **kwargs)
44
45
46def _to_csv(file, encoding, errors, **kwargs):

Callers

nothing calls this directly

Calls 2

BoxErrorClass · 0.90
from_jsonMethod · 0.45

Tested by

no test coverage detected