Liking cljdoc? Tell your friends :D

clj-yfinance.parquet

Optional Parquet save/load functions for clj-yfinance datasets.

REQUIRES: Add to your deps.edn aliases: {:parquet {:extra-deps {com.techascent/tmd-parquet {:mvn/version "1.000-beta-39"} techascent/tech.ml.dataset {:mvn/version "7.032"}}}}

Then start your REPL with: clojure -M:parquet:nrepl

USAGE: (require '[clj-yfinance.parquet :as yfp])

;; Save and load historical data (yfp/save-historical! "AAPL" "aapl.parquet" :period "5y") (yfp/load-historical "aapl.parquet")

;; Save a multi-ticker dataset in one file (yfp/save-multi-ticker! ["AAPL" "GOOGL" "MSFT"] "prices.parquet" :period "1y") (yfp/load-dataset "prices.parquet")

Optional Parquet save/load functions for clj-yfinance datasets.

REQUIRES: Add to your deps.edn aliases:
{:parquet {:extra-deps {com.techascent/tmd-parquet {:mvn/version "1.000-beta-39"}
                        techascent/tech.ml.dataset {:mvn/version "7.032"}}}}

Then start your REPL with: clojure -M:parquet:nrepl

USAGE:
(require '[clj-yfinance.parquet :as yfp])

;; Save and load historical data
(yfp/save-historical! "AAPL" "aapl.parquet" :period "5y")
(yfp/load-historical "aapl.parquet")

;; Save a multi-ticker dataset in one file
(yfp/save-multi-ticker! ["AAPL" "GOOGL" "MSFT"] "prices.parquet" :period "1y")
(yfp/load-dataset "prices.parquet")
raw docstring

load-datasetclj

(load-dataset path)

Load any Parquet file and return a dataset. Column names are keywordized on load.

Example: (load-dataset "prices.parquet")

Load any Parquet file and return a dataset. Column names are keywordized on load.

Example:
(load-dataset "prices.parquet")
sourceraw docstring

load-historicalclj

(load-historical path)

Load a Parquet file saved by save-historical! and return a dataset.

Column names are keywordized on load. Column types are restored as saved: :timestamp (int64), OHLCV as float64/int64.

Example: (load-historical "aapl.parquet")

Load a Parquet file saved by save-historical! and return a dataset.

Column names are keywordized on load. Column types are restored as saved:
:timestamp (int64), OHLCV as float64/int64.

Example:
(load-historical "aapl.parquet")
sourceraw docstring

save-dataset!clj

(save-dataset! ds path)

Save an arbitrary tech.v3.dataset to a Parquet file.

Use this when you have already transformed a dataset and want to persist it.

Example: (require '[tablecloth.api :as tc]) (-> (yfd/historical->dataset "AAPL" :period "1y") (tc/add-column :log-return ...) (yfp/save-dataset! "aapl-enriched.parquet"))

Save an arbitrary tech.v3.dataset to a Parquet file.

Use this when you have already transformed a dataset and want to persist it.

Example:
(require '[tablecloth.api :as tc])
(-> (yfd/historical->dataset "AAPL" :period "1y")
    (tc/add-column :log-return ...)
    (yfp/save-dataset! "aapl-enriched.parquet"))
sourceraw docstring

save-historical!clj

(save-historical! ticker path & opts)

Fetch historical OHLCV data for ticker and save to a Parquet file.

Returns the dataset on success, nil if fetch fails or data is empty.

Options are passed through to fetch-historical: :period, :interval, :start, :end, :adjusted, :prepost

Examples: (save-historical! "AAPL" "aapl.parquet" :period "5y") (save-historical! "TSLA" "tsla-1h.parquet" :start start-inst :end end-inst :interval "1h")

Fetch historical OHLCV data for ticker and save to a Parquet file.

Returns the dataset on success, nil if fetch fails or data is empty.

Options are passed through to fetch-historical:
:period, :interval, :start, :end, :adjusted, :prepost

Examples:
(save-historical! "AAPL" "aapl.parquet" :period "5y")
(save-historical! "TSLA" "tsla-1h.parquet" :start start-inst :end end-inst :interval "1h")
sourceraw docstring

save-multi-ticker!clj

(save-multi-ticker! tickers path & opts)

Fetch historical OHLCV data for multiple tickers and save to a single Parquet file.

The dataset includes a :ticker column to identify each row's source. Returns the combined dataset on success, nil if all fetches fail.

Options are passed through to fetch-historical: :period, :interval, :start, :end, :adjusted, :prepost

Examples: (save-multi-ticker! ["AAPL" "GOOGL" "MSFT"] "tech.parquet" :period "1y") (save-multi-ticker! tickers "portfolio.parquet" :period "5y")

Fetch historical OHLCV data for multiple tickers and save to a single Parquet file.

The dataset includes a :ticker column to identify each row's source.
Returns the combined dataset on success, nil if all fetches fail.

Options are passed through to fetch-historical:
:period, :interval, :start, :end, :adjusted, :prepost

Examples:
(save-multi-ticker! ["AAPL" "GOOGL" "MSFT"] "tech.parquet" :period "1y")
(save-multi-ticker! tickers "portfolio.parquet" :period "5y")
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close