Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alessiosavi/coinbase-fetcher
https://github.com/alessiosavi/coinbase-fetcher
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/alessiosavi/coinbase-fetcher
- Owner: alessiosavi
- Created: 2021-04-13T17:50:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T01:34:25.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T04:49:09.519Z (7 months ago)
- Language: Go
- Size: 55.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# go-coinbase-fetcher
#### A simple go library delegated to store the history from coinbase.com for any given currency
## Functionalities:
- The `Downloader` have the following parameter: `Granularity`, `Pair`, `LimitDate`:
- Granularity: 60, 300, 900, 3600, 21600, 86400;
- Pair: coinbase pair;
- Limit date: stop date (download all from now since `limit date`);
- The `Downloader` create a `csv` file using the input parameter, an
example: `BTC-USD-86400-2015-01-01T00:00:00Z-2022-02-28T00:39:03Z.csv`;
- The `csv` file created is processed in streaming. Once that a `batch` of 300 rows have been downloaded, the result is
store into the file; serialized as `csv`;Example:
```go
// ...
var opts = datastructure.DownloadOpts{
Granularity: datastructure.GRANULARITY_DAY,
Pair: "BTC-USD",
LimitDate: time.Date(2015, 01, 01, 0, 0, 0, 0, time.UTC),
}
// ...
```#### Once initialized, the downloader is delegated to download the data for the given pair in the given period
```go
download := opts.New()
filename := download.Download(nil)
```#### A progressbar will show the number estimated finish time and other information:
```text
2021-08-09T00:30:00Z 7% |█████████████████ | (65/836, 5 it/s) [15s:2m34s]
```### The manager
The `Manager` is delegated to perform few operation on the file:
- Sort
- Drop duplicates```go
var manager datastructure.Manager
manager.Sort(filename)
manager.DropDuplicates(filename)
```