bloomberg_dl 0.2.1

D library for Bloomberg Data License API


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

bloomberg_dl

Purpose

Support BloomBerg Data License SFTP get data and get historical data

Preparation

Must install the libssh develop library ubuntu: sudo apt-get install libssh-dev

Build

Build Library

dub build

Build Tools

dub build -c tools

API Overriew

Get Data API:

###

*********************************************************************************
host -- Bloomberg Host(SFTP) / ""(WebService Soap)
user -- UserName(SFTP) / p12_certificate_path(WebService Soap)
pass -- Password(SFTP) / p12_certificate_password(WebService Soap) 
fields -- Request fields
idents -- BBGIDs
withHeader -- Whether the result first line has header
interval -- Check SFTP server interval in seconds
retry -- how many time to retry check SFTP server for the result
<Return Type> -- string[][] Array
*********************************************************************************
static string[][] getData(string host, string user, string pass, string[] fields, string[] idents, bool withHeader = true,  long interval = 10, long retry = 100)

###

*********************************************************************************
host -- Bloomberg Host(SFTP) / ""(WebService Soap)
user -- UserName(SFTP) / p12_certificate_path(WebService Soap)
pass -- Password(SFTP) / p12_certificate_password(WebService Soap) 
fields -- Request fields
idents -- BBGIDs
withHeader -- Whether the result first line has header
interval -- Check SFTP server interval in seconds
retry -- how many time to retry check SFTP server for the result
<Return Type> A CSV format string
*********************************************************************************
static string getDataCsv(string host, string user, string pass, string[] fields, string[] idents, bool withHeader = true,  long interval = 10, long retry = 100)

###

*********************************************************************************
host -- Bloomberg Host(SFTP) / ""(WebService Soap)
user -- UserName(SFTP) / p12_certificate_path(WebService Soap)
pass -- Password(SFTP) / p12_certificate_password(WebService Soap) 
fields -- Request fields
idents -- BBGIDs
path -- file save path
level -- gzip level, 0-9, input 0 will not zip, 1-9 will zip the file to path.gz
withHeader -- Whether the result first line has header
interval -- Check SFTP server interval in seconds
retry -- how many time to retry check SFTP server for the result
<Return Type> void
*********************************************************************************
static void downloadData(string host, string user, string pass, string[] fields, string[] idents, string path, int level = 0,  bool withHeader = true,  long interval = 10, long retry = 100)

Get Historical Data API:

###

*********************************************************************************
host -- Bloomberg Host(SFTP) / ""(WebService Soap)
user -- UserName(SFTP) / p12_certificate_path(WebService Soap)
pass -- Password(SFTP) / p12_certificate_password(WebService Soap) 
fields -- Request fields
idents -- BBGIDs
source -- Historical data source, BGN as an example
startDate -- Historical data start date
endDate -- Historical data start date
withHeader -- Whether the result first line has header
interval -- Check SFTP server interval in seconds
retry -- how many time to retry check SFTP server for the result
<Return Type> -- string[][] Array
*********************************************************************************
static string[][] getHistorical(string host, string user, string pass, string[] fields, string[] idents, string source, long startDate, long endDate, bool withHeader = true,  long interval = 10, long retry = 100)
*********************************************************************************
host -- Bloomberg Host(SFTP) / ""(WebService Soap)
user -- UserName(SFTP) / p12_certificate_path(WebService Soap)
pass -- Password(SFTP) / p12_certificate_password(WebService Soap) 
fields -- Request fields
idents -- BBGIDs
source -- Historical data source, BGN as an example
startDate -- Historical data start date
endDate -- Historical data start date
withHeader -- Whether the result first line has header
interval -- Check SFTP server interval in seconds
retry -- how many time to retry check SFTP server for the result
<Return Type> -- A CSV format string
*********************************************************************************
static string[][] getHistoricalCsv(string host, string user, string pass, string[] fields, string[] idents, string source, long startDate, long endDate, bool withHeader = true,  long interval = 10, long retry = 100)
*********************************************************************************
host -- Bloomberg Host(SFTP) / ""(WebService Soap)
user -- UserName(SFTP) / p12_certificate_path(WebService Soap)
pass -- Password(SFTP) / p12_certificate_password(WebService Soap) 
fields -- Request fields
idents -- BBGIDs
source -- Historical data source, BGN as an example
startDate -- Historical data start date
endDate -- Historical data start date
path -- file save path
level -- gzip level, 0-9, input 0 will not zip, 1-9 will zip the file to path.gz
withHeader -- Whether the result first line has header
interval -- Check SFTP server interval in seconds
retry -- how many time to retry check SFTP server for the result
<Return Type> -- A CSV format string
*********************************************************************************
static void downloadHistorical(string host, string user, string pass, string[] fields, string[] idents, string source, long startDate, long endDate, string path, int level = 0, bool withHeader = true,  long interval = 10, long retry = 100)

Example

#SFTP example run example ./example.sh <host> <user> <pass>

#SOAP example run example ./example.sh "" <p12certificatefile> <p12certificatefile_password>

refer tools/tools.d to learn how to use the API

Dependencies:
libssh-d
Versions:
0.2.1 2021-Apr-15
0.2.0 2021-Apr-15
0.1.3 2021-Apr-15
0.1.2 2021-Apr-15
0.1.1 2021-Apr-15
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 16 downloads total

Score:
0.5
Short URL:
bloomberg_dl.dub.pm