This commit is contained in:
Elijah McMorris 2023-06-14 02:35:45 +00:00
parent bc28230cbe
commit 5b05079edb
Signed by: NexVeridian
SSH key fingerprint: SHA256:bsA1SKZxuEcEVHAy3gY1HUeM5ykRJl0U0kQHQn0hMg8
5 changed files with 19100 additions and 11 deletions

View file

@ -1,9 +1,8 @@
# https://mcr.microsoft.com/en-us/product/devcontainers/rust/about
FROM mcr.microsoft.com/devcontainers/rust:bullseye
RUN rustup target add x86_64-unknown-linux-musl && \
apt-get update && \
apt install -y build-essential xz-utils musl-tools musl-dev gcc-multilib pkg-config libssl-dev && \
rustup update
RUN apt-get update && \
apt install -y build-essential xz-utils musl-tools musl-dev gcc-multilib pkg-config libssl-dev
RUN LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+') && \
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" && \

View file

@ -41,7 +41,7 @@
// },
"postAttachCommand": {
"AddGitSafeDir": "git config --global --add safe.directory /workspaces/${containerWorkspaceFolderBasename}",
"cargo_update": "cargo update",
"update": "rustup target add x86_64-unknown-linux-musl && rustup update && cargo update",
"clippy": "cargo clippy --fix --allow-dirty"
},
// Configure tool-specific properties.

View file

@ -1,2 +1,4 @@
https://ark-funds.com/ark-trade-notifications/
https://etfs.ark-funds.com/hubfs/idt/trades/ARK_Trade_06072023_0800PM_EST_6480efd1294b5.xls
cargo clean && cargo build --timings

19081
bullseye.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -62,11 +62,19 @@ pub enum Source {
pub fn update_parquet(ticker: Ticker, source: Source) -> Result<(), Box<dyn Error>> {
let mut df = read_parquet(ticker)?;
let last_day = df.clone().collect()?.column("date").unwrap().max();
let update = match source {
Source::Ark => get_csv_ark(ticker)?,
Source::ApiIncremental => get_api(ticker, last_day)?,
Source::ApiIncremental => {
let last_day = df
.clone()
.collect()?
.column("date")
.unwrap()
.max()
.and_then(NaiveDate::from_num_days_from_ce_opt);
get_api(ticker, last_day)?
}
Source::ApiFull => get_api(ticker, None)?,
};
@ -232,16 +240,15 @@ pub fn df_format(df: LazyFrame) -> Result<DataFrame, Box<dyn Error>> {
Ok(df)
}
pub fn get_api(ticker: Ticker, last_day: Option<i32>) -> Result<LazyFrame, Box<dyn Error>> {
pub fn get_api(ticker: Ticker, last_day: Option<NaiveDate>) -> Result<LazyFrame, Box<dyn Error>> {
let url = match (ticker, last_day) {
(Ticker::ARKVC, Some(last_day)) => format!(
"https://api.nexveridian.com/arkvc_holdings?end={}",
NaiveDate::from_num_days_from_ce_opt(last_day).unwrap()
last_day
),
(ticker, Some(last_day)) => format!(
"https://api.nexveridian.com/ark_holdings?ticker={}&end={}",
ticker,
NaiveDate::from_num_days_from_ce_opt(last_day).unwrap()
ticker, last_day
),
(Ticker::ARKVC, None) => "https://api.nexveridian.com/arkvc_holdings".to_owned(),
(ticker, None) => {