bloomberg

Crates.iobloomberg
lib.rsbloomberg
version0.2.0
sourcesrc
created_at2024-05-11 11:55:51.216217
updated_at2024-05-11 11:55:51.216217
descriptionRust API for Bloomberg.
homepage
repositoryhttps://github.com/alexandrebrilhante/bloomberg
max_upload_size
id1236828
size161,944
Alexandre Brilhante (alexandrebrilhante)

documentation

README

bloomberg

A Rust wrapper for Bloomberg's blpapi.

This is a work in progress and not intended to be used in production in its current version.

Installation

Download and install the Install C/C++ BLPAPI and set the BLPAPI_LIB environment variable to the extract path.

Add the following the following to your Cargo.toml:

[dependencies]
bloomberg = { version = "0.2.0" }

Example

Historical Data

use blpapi::{RefData, session::{SessionSync, HistOptions}};

#[derive(Default, RefData)]
struct Price {
    px_last: f64,
}

fn main() {
    let mut session = SessionSync::new().unwrap();

    let securities: &[&str] = &[ "IBM US Equity" ];

    let options = HistOptions::new("20240401", "20240430");

    let prices = session.hist_data::<_, Price>(securities, options);

    prices
}
Commit count: 6

cargo fmt