Crates.io | blpapi-derive |
lib.rs | blpapi-derive |
version | 0.0.1 |
source | src |
created_at | 2019-11-07 06:53:09.545055 |
updated_at | 2019-11-07 06:53:09.545055 |
description | Proc-macro derive for bloomberg's blpapi library |
homepage | |
repository | https://github.com/tafia/blpapi-rs |
max_upload_size | |
id | 178921 |
size | 4,756 |
A rust wrapper for Bloomberg blpapi.
This is a Work In Progress, I do not plan on getting to parity with the C++ API. On the other hand, I very welcome any contribution!
Tested on Windows only (DesktopApi). Compiles on Linux. Tested version: 3.12.3.1
BLPAPI_LIB
environment variable
a. On windows: # Cargo.toml
[dependencies]
blpapi = { version = "0.0.1", features = [ "derive", "dates" ] }
use blpapi::{RefData, session::SessionSync};
// use the derive feature to automatically convert field names into bloomberg fields
#[derive(Default, RefData)]
struct EquityData {
ticker: String,
crncy: String,
market_status: Option<String>,
}
let mut session = SessionSync::new().unwrap();
let securities: &[&str] = &[ /* list of security tickers */ ];
let maybe_equities = session.ref_data::<_, EquityData>(securities);
use blpapi::{RefData, session::{SessionSync, HistOptions}};
// use the **derive** feature to automatically convert field names into bloomberg fields
#[derive(Default, RefData)]
struct Price {
px_last: f64,
}
let mut session = SessionSync::new().unwrap();
let securities: &[&str] = &[ /* list of security tickers */ ];
let options = HistOptions::new("20190101", "20191231");
let prices = session.hist_data::<_, Price>(securities, options);