Skip to content

TiingoNewsJsonConverter

QuantConnect.DataSource.TiingoNewsJsonConverter

TiingoNewsJsonConverter(
    symbol: Union[Symbol, str, BaseContract] = None,
)

Bases: JsonConverter

Helper json converter class used to convert a list of Tiingo news data into List{TiingoNews}

Creates a new instance of the json converter

Parameters:

Name Type Description Default
symbol Union[Symbol, str, BaseContract]

The Symbol instance associated with this news

None

can_convert

can_convert(object_type: Type) -> bool

Determines whether this instance can convert the specified object type.

Parameters:

Name Type Description Default
object_type Type

Type of the object.

required

Returns:

Type Description
bool

true if this instance can convert the specified object type; otherwise, false.

deserialize_news

deserialize_news(token: Any) -> TiingoNews

Helper method to deserialize a single json Tiingo news

Parameters:

Name Type Description Default
token Any

The json token containing the Tiingo news to deserialize

required

Returns:

Type Description
TiingoNews

The deserialized TiingoNews instance.

read_json

read_json(
    reader: Any,
    object_type: Type,
    existing_value: Any,
    serializer: Any,
) -> Object

Reads the JSON representation of the object.

Parameters:

Name Type Description Default
reader Any

The Newtonsoft.Json.JsonReader to read from.

required
object_type Type

Type of the object.

required
existing_value Any

The existing value of object being read.

required
serializer Any

The calling serializer.

required

Returns:

Type Description
Object

The object value.

write_json

write_json(
    writer: Any, value: Any, serializer: Any
) -> None

Writes the JSON representation of the object.

Parameters:

Name Type Description Default
writer Any

The Newtonsoft.Json.JsonWriter to write to.

required
value Any

The value.

required
serializer Any

The calling serializer.

required