Skip to content

Commit

Permalink
See if i can precompile
Browse files Browse the repository at this point in the history
  • Loading branch information
eohne committed Aug 7, 2024
1 parent f800d5c commit 2e0f5f0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"


[weakdeps]
TSFrames = "9f90e835-9451-4aaa-bcb1-743a1b8d2f84"
TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e"

[extensions]
YFinance_TimeSeries = "TimeSeries"
YFinance_TSFrames = "TSFrames"
YFinance_TimeSeries = "TimeSeries"

[compat]
Base64 = "1"
HTTP = "1.2"
JSON3 = "1"
OrderedCollections = "1.3"
julia = "1.6"
TimeSeries = "0.24"
TSFrames = "0.2.2"
TimeSeries = "0.24"
julia = "1.6"
PrecompileTools="1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TSFrames = "9f90e835-9451-4aaa-bcb1-743a1b8d2f84"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e"


[targets]
test = ["Test"]
12 changes: 12 additions & 0 deletions src/YFinance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module YFinance
using HTTP
using JSON3
using Random
using PrecompileTools: @setup_workload, @compile_workload

export _PROXY_SETTINGS, create_proxy_settings,clear_proxy_settings, _set_cookies_and_crumb
export validate_symbol,get_valid_symbols,get_prices, get_dividends, get_splits
Expand Down Expand Up @@ -33,4 +34,15 @@ module YFinance
include("ESG.jl");
include("Search_Symbol.jl");
include("News_Search.jl");


@setup_workload begin
@compile_workload begin
get_prices("AAPL",interval = "1m",range="1d")
get_prices("AAPL",interval = "1d",startdtd=Date(2009,01,01), enddt = Date(2009,01,05))
get_prices("AAPL",interval = "1d",startdtd="2009-01-01", enddt = "2009-01-05")
get_prices("AAPL",interval = "1d",startdtd="2009-01-01", enddt = "2009-01-05",prepost=true)
get_prices("AAPL",interval = "1d",startdtd="2009-01-01", enddt = "2009-01-05",divsplits=true)
end
end
end

0 comments on commit 2e0f5f0

Please sign in to comment.