import json


def serialize_json(obj, **kwargs):
    """Encode python object into a JSON string.

    Args:
        obj (:obj:`object`):
            Python object to encode into a string.
        **kwargs:
            indent (:obj:`int`):
                Indent spacing for prettifying.

                Defaults to: 2.
            rest of kwargs:
                Passed to :func:`json.dumps`.

    Returns:
        :obj:`str`

    """
    kwargs.setdefault("indent", 2)
    return json.dumps(obj, **kwargs)