Skip to content

Commit cbeb769

Browse files
authored
Merge pull request #83 from Arkoniak/version_update
Bump
2 parents 27f4ad6 + 2fe84e6 commit cbeb769

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MarketData.jl is licensed under the MIT License (MIT)
22

3-
Copyright (c) 2013-2021 Algorithm Alpha, LLC
3+
Copyright (c) 2013-2022 Algorithm Alpha, LLC
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

Project.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MarketData"
22
uuid = "945b72a4-3b13-509d-9b46-1525bb5c06de"
33
authors = ["JuliaQuant <https://github.com/JuliaQuant>"]
4-
version = "0.13.9"
4+
version = "0.13.10"
55

66
[deps]
77
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
@@ -18,7 +18,7 @@ HTTP = "0.8, 0.9"
1818
Reexport = "0.2, 1.0"
1919
TimeSeries = "0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23"
2020
julia = "1"
21-
JSON3 = "1.9.1"
21+
JSON3 = "1"
2222

2323
[extras]
2424
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/downloads.jl

+13-13
Original file line numberDiff line numberDiff line change
@@ -165,31 +165,31 @@ https://www.ons.gov.uk/timeseriestool
165165
- fred() which accesses the St. Louis Federal Reserve financial and economic data sets.
166166
- yahoo() which is a wrapper from downloading financial time series for stocks from Yahoo Finance.
167167
"""
168-
function ons(timeseries::AbstractString="L522",dataset::AbstractString="MM23")
168+
function ons(timeseries::AbstractString = "L522", dataset::AbstractString = "MM23")
169169
url = "https://api.ons.gov.uk/dataset/$dataset/timeseries/$timeseries/data"
170170
res = HTTP.get(url)
171171
@assert res.status == 200
172-
json = JSON3.read(String(res.body))
172+
json = JSON3.read(HTTP.payload(res))
173173
ta = nothing
174174
if "months" in keys(json)
175175
data = json["months"]
176-
dates = [Date(x["year"]*" "*x["month"],dateformat"Y U") for x in data]
177-
values = [parse(Float64,x["value"]) for x in data]
178-
ta = TimeArray((timestamp=dates,monthly=values),timestamp=:timestamp)
176+
dates = [Date(x["year"]*" "*x["month"], dateformat"Y U") for x in data]
177+
values = [parse(Float64, x["value"]) for x in data]
178+
ta = TimeArray((timestamp = dates, monthly = values),timestamp=:timestamp)
179179
end
180180
if "quarters" in keys(json)
181181
data = json["quarters"]
182-
dates = [Date(x["year"]*" "*string(parse(Int,x["quarter"][2])*3-2),dateformat"Y m") for x in data]
182+
dates = [Date(x["year"]*" "*string(parse(Int, x["quarter"][2])*3-2),dateformat"Y m") for x in data]
183183
values = [parse(Float64,x["value"]) for x in data]
184-
tb = TimeArray((timestamp=dates,quarterly=values),timestamp=:timestamp)
185-
ta === nothing ? ta = tb : ta = merge(ta,tb;method=:outer)
184+
tb = TimeArray((timestamp = dates, quarterly = values), timestamp = :timestamp)
185+
ta === nothing ? ta = tb : ta = merge(ta, tb; method = :outer)
186186
end
187187
if "years" in keys(json)
188188
data = json["years"]
189189
dates = [Date(x["year"]) for x in data]
190-
values = [parse(Float64,x["value"]) for x in data]
191-
tb = TimeArray((timestamp=dates,yearly=values),timestamp=:timestamp)
192-
ta === nothing ? ta = tb : ta = merge(ta,tb;method=:outer)
190+
values = [parse(Float64, x["value"]) for x in data]
191+
tb = TimeArray((timestamp = dates, yearly = values), timestamp = :timestamp)
192+
ta === nothing ? ta = tb : ta = merge(ta, tb; method = :outer)
193193
end
194-
TimeArray(ta,meta=json["description"])
195-
end
194+
TimeArray(ta, meta = json["description"])
195+
end

test/downloads.jl

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ using Test
77
@test ta |> timestamp |> length > 100
88
ta = fred("DGS10")
99
@test ta |> timestamp |> length > 100
10-
@test !(ta isa TimeArray{T} where T<:AbstractString)
1110
end
1211

1312
@testset "Yahoo" begin

0 commit comments

Comments
 (0)