Skip to main content

ExportDataJsonKwargs

Keyword arguments for dataset's export_data_json method.

Index

Properties

keyword-onlyoptionalallow_nan

allow_nan: bool

If False (default: True), raises a ValueError for out-of-range float values (nan, inf, -inf) to strictly comply with the JSON specification. If True, uses their JavaScript equivalents (NaN, Infinity, -Infinity).

keyword-onlyoptionalcheck_circular

check_circular: bool

If False (default: True), skips the circular reference check for container types. A circular reference will result in a RecursionError or worse if unchecked.

keyword-onlyoptionalcls

cls: type[json.JSONEncoder]

Allows specifying a custom JSON encoder.

keyword-onlyoptionaldefault

default: Callable

A function called for objects that can't be serialized otherwise. It should return a JSON-encodable version of the object or raise a TypeError.

keyword-onlyoptionalensure_ascii

ensure_ascii: bool

Determines if non-ASCII characters should be escaped in the output JSON string.

keyword-onlyoptionalindent

indent: int

Specifies the number of spaces for indentation in the pretty-printed JSON output.

keyword-onlyoptionalseparators

separators: tuple[str, str]

A tuple of (item_separator, key_separator). The default is (', ', ': ') if indent is None and (',', ': ') otherwise.

keyword-onlyoptionalskipkeys

skipkeys: bool

If True (default: False), dict keys that are not of a basic type (str, int, float, bool, None) will be skipped instead of raising a TypeError.

keyword-onlyoptionalsort_keys

sort_keys: bool

Specifies whether the output JSON object should have keys sorted alphabetically.