How to use the jsonlines.jsonlines.Error function in jsonlines

To help you get started, we’ve selected a few jsonlines examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wbolster / jsonlines / jsonlines / jsonlines.py View on Github external
dict: dict,
    list: list,
    str: six.text_type,
    int: six.integer_types,
    float: float,
    numbers.Number: numbers.Number,
    bool: bool,
}


class Error(Exception):
    """Base error class."""
    pass


class InvalidLineError(Error, ValueError):
    """
    Error raised when an invalid line is encountered.

    This happens when the line does not contain valid JSON, or if a
    specific data type has been requested, and the line contained a
    different data type.

    The original line itself is stored on the exception instance as the
    ``.line`` attribute, and the line number as ``.lineno``.

    This class subclasses both ``jsonlines.Error`` and the built-in
    ``ValueError``.
    """
    #: The invalid line
    line = None

jsonlines

Library with helpers for the jsonlines file format

BSD-2-Clause
Latest version published 1 year ago

Package Health Score

68 / 100
Full package analysis

Similar packages