ark-invest-api-rust-data/README.md
2023-11-20 11:41:23 -08:00

67 lines
1.9 KiB
Markdown

Fetches and caches ETF data daily, from csv download or api, and saves the data in parquet format
[api.NexVeridian.com](https://api.NexVeridian.com)
Not affiliated with Ark Invest
# Install
Copy docker-compose.yml
Create data folder next to docker-compose.yml
```
├───data
│ └───parquet
├───docker-compose.yml
```
`docker compose up --pull always`
# Changing the data source
In docker-compose.yml, change the data source by changing the environment variable
```
environment:
- ARK_SOURCE=ApiIncremental
```
Env string ARK_SOURCE must be in the enum Source
```
pub enum Source {
// Reads Parquet file if exists
Read,
// From ARK Invest
Ark,
// From api.NexVeridian.com
#[default]
ApiIncremental,
// From api.NexVeridian.com, not usually nessisary, use ApiIncremental
ApiFull,
// From arkfunds.io/api, avoid using, use ApiIncremental instead
ArkFundsIoIncremental,
// From arkfunds.io/api, avoid using, use ApiFull instead
ArkFundsIoFull,
}
```
# Dev Install
## Dev Containers
Install docker, vscode and the [Dev Containers Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
`git clone`
`Ctrl+Shift+P` **Dev Containers: Open Folder in Container**
Run code with `F5` or `cargo run`
Run tests with `cargo t`
## Docker Compose
`git clone`
`docker compose -f docker-compose.dev.yml build && docker compose -f docker-compose.dev.yml up`
Remove the cargo cache for buildkit with `docker builder prune --filter type=exec.cachemount`
# License
All code in this repository is dual-licensed under either [License-MIT](./LICENSE-MIT) or [LICENSE-APACHE](./LICENSE-Apache) at your option. This means you can select the license you prefer.
[Why dual license](https://github.com/bevyengine/bevy/issues/2373)