Time Series Parser
Turns a decoded stock time series payload into a TimeSeriesResponse.
The cadences number their metadata keys differently — only intraday reports an interval, and the weekly and monthly headers are shorter — so the parser reads the header positionally, deciding which numbering is in use by which of the fourth-position keys is present.
Per-bar keys are numbered by cadence too, which is what the adjusted flag resolves: in an unadjusted payload the fifth key is the volume, while in an adjusted one it is the adjusted close and the volume moves to sixth.
Functions
Link copied to clipboard
Link copied to clipboard
Wraps a parse failure or an API error message in a response.
Link copied to clipboard
Link copied to clipboard
Decodes a raw JSON response body into a generic
String-keyed map, with the NoneableDouble/NoneableLong adapters registered so numeric-or-"None" fields decode correctly.Decodes a raw JSON response body directly into an instance of
c, with the NoneableDouble/NoneableLong adapters registered so numeric-or-"None" fields decode correctly.Link copied to clipboard
Converts an already-decoded JSON value, typically a
List produced by parseJSON, into a List of klass instances, with the NoneableDouble/NoneableLong adapters registered so numeric-or-"None" fields decode correctly.Link copied to clipboard
Encodes a
String-keyed map back into a JSON string, with the NoneableDouble/NoneableLong adapters registered.