Chartmetric

Documentation for Chartmetric.

Chartmetric.RequestType
Request(token::Token, url::String[, maxtries::Int, sleeptime::Number, state::Dict])
Request(refreshtoken::String, url::String[, maxtries::Int, sleeptime::Number])

Creates a Request to be used with dorequest(...)

Arguments:

  • token : the request Token
  • url : Chartmetric URL to be requested
  • [maxtries] : maximum number of tries to get the request (default = token.maxtries)
  • [sleeptime] : Time to wait after server error in seconds (default = 600)
  • [state] : Metadata for a request. Allows multiple requests of the same variable with different offset.
  • refreshtoken : Chartmetric refreshtoken associated with your account
Chartmetric.TokenType
Token(refreshtoken::String)

Returns a Token that can be used for requests.

Arguments:

  • refreshtoken : Refreshtoken associated with your Chartmetric account.
Chartmetric.dorequestMethod
dorequest(request::Request)

Run the request using a Request object

Arguments:

  • request : the Request object
  • skip404 = true : If true 404 errors will not be retried
  • verbose = false : If true all unusual events (e.g. rate limit is hit) will print a message
Chartmetric.getparsedFunction
getparsed(tkn, path, parameters = nothing; kwargs...)

Do a full request and return a Dict of the response. Keyword arguments are passed to Request and are maxtries and sleeptime.

Arguments:

  • token: the request Token
  • path: Chartmetric API path
  • parameters=nothing: Chartmetric parameters of the form ["limit=100", "since=2020-01-01"]
  • skip404 = true : If true 404 errors will not be retried
  • verbose = false : If true all unusual events (e.g. rate limit is hit) will print a message
Chartmetric.newtoken!Method
newtoken!(token::Token; verbose = false)

Refreshes an existing request Token

Arguments:

  • token : the request Token
  • verbose=false : print a message when a new token is requested
Chartmetric.parseresponseMethod
parseresponse(response::HTTP.Messages.Response)

Parses the response from the API to a Dict.