Skip to content

rhinocerose/polystock-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example workflow

polystock-rs

Testing adapted from this tutorial.

Passing Variables

Required parameters:

  • -t or --tickers: An array of space separated, quote-wrapped tickers

CLI Manifest Add

cargo install cargo-edit
cargo add {CRATE}

Reading environment variables:

use std::env;
use dotenv::dotenv;
use finnhub_rs::client::Client;

const FINNHUB_KEY: &str = "FINNHUB_TOKEN";

#[tokio::main]
async fn main() {
    dotenv().ok();
    let token = env::var(FINNHUB_KEY).expect("Key not present in .env file");
    let client = Client::new(token);

    let res = client.stock_symbol("US".to_string()).await.expect("Invalid response");
    println!("{:#?}", res);
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages