alpha-xone / xbbg

An intuitive Bloomberg API
https://xbbg.readthedocs.io/
Apache License 2.0
244 stars 51 forks source link

cannot specify server ip, only the port #53

Open edop2005 opened 2 years ago

edop2005 commented 2 years ago

You can specify the server port in kwargs but no the server ip, it s always localhost by default

in line 91 of conn.py if sess_opts.setServerHost('localhost')

was replaced by sess_opts.setServerHost(kwargs.get('server', SERVER))

and defining SERVER= 'localhost'

we could pass the server in kwargs with these changes the script below runs ok

from xbbg import blp kwargs = {'server': 192.168.1.100', "port": 18194} # , "port" : 8194 print(blp.bdp(tickers='NVDA US Equity', flds=['Security_Name', 'GICS_Sector_Name'], **kwargs)) print('finished')