Liking cljdoc? Tell your friends :D

bortexz.bybit.public-data


download!clj

(download! {:keys [market index date-str]})

Return input stream of csv.gzip file, given opts map:

  • :index e/o #{:trading :spot :premium}
  • :market instrument symbol to download data from
  • :date-str date to download as string in format 'YYYY-MM-DD'

See: https://public.bybit.com/

Note: The input stream is from a gzipped file, you have to pipe it through a GZipInputStream to read it line by line.

Note: Some files might come in reverse order, first line (after csv header) being last event of the day. (Observed in :trading index 'BTCUSD' market, where format was changed in 07-12-2021 from decreasing time to increasing time, also changing timestamp from seconds.micros to only seconds).

Example:

(->> (download! :trading "BTCUSD" "2020-01-01")
     (java.util.zip.GZIPInputStream.) 
     (clojure.java.io/reader)
     (line-seq))
Return input stream of csv.gzip file, given opts map:
- `:index` e/o #{:trading :spot :premium}
- `:market` instrument symbol to download data from
- `:date-str` date to download as string in format 'YYYY-MM-DD'

See: https://public.bybit.com/

Note: The input stream is from a gzipped file, you have to pipe it through a GZipInputStream
to read it line by line.

Note: Some files might come in reverse order, first line (after csv header) being last event of 
the day. (Observed in :trading index 'BTCUSD' market, where format was changed in 07-12-2021 from
decreasing time to increasing time, also changing timestamp from seconds.micros to only seconds).

Example:

```clojure
(->> (download! :trading "BTCUSD" "2020-01-01")
     (java.util.zip.GZIPInputStream.) 
     (clojure.java.io/reader)
     (line-seq))
```
sourceraw docstring

download-as-lines!clj

(download-as-lines! opts)

Downloads the content of a file using download! and return its lines as seq, dropping the headers line.

opts map: See download!

Downloads the content of a file using [[download!]] and return its lines as seq, dropping the 
headers line.

opts map: See [[download!]]
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close