I have access to a bloomberg terminal and python on the same computer. I tried to look on internet and on this forum for some useful tips/introduction to automate bloomberg tasks, although I didn't find anything. How can the terminal be automated? Is it possible to do something similar to webscraping with an external application? Or the only way is to use Sendkeys method? (In my case I want to automate ISIN typing, print screen (for which I found a code in this forum using API calls) and data analysis (so scrape the data showed). I'm aware of bloomberg add-in for excel but it's quite limited.
Automating the terminal can be done using the TerminalConnect Api.
It's not possible to 'scrape' data from the terminal, but you can access data using the Desktop Api (DAPI).
What you want is to use the API.
Bloomberg makes it easy to do this in Excel. You need to install Bloomberg API plugin.
If you need to do this ‘programmatically’, there are API written in different languages. Use WAPI in your terminal to find out.
Related
My company uses Office 365 within OneLogin. Therefore I need to log in to OneLogin first then sign into Office 365 (OneDrive). My question is how do I do the authentication for this in Python? I want to read the excel file stored in OneDrive directly. I tried to retrieve the data directly using python requests module with HTTPBasicAuth and HttpNtlmAuth only to get error 403. I have checked about Python-saml.
https://github.com/onelogin/python-saml
However, I am not sure this is what I need. This seems more like create a server for OneLogin using Python. What is the correct approach for doing this?
Unfortunately, I have not found out a way to do this using Python packages. There is one workaround though. I used Selenium to simulate log in like a real human and click like how the real human could. It requires some scripting but this way it can bypass the OneLogin security (and other types of complicated security login).
I dont even know if this is possible. But if it is, can someone give me the broadstrokes on how I can use a Python script to populate a Google spreadsheet?
I want to scrape data from a web site and dump it into a google spreadsheet. I can imagine what the Python looks like (scrapy, etc). But does the language support writing to Google Drive? Can I kick off the script within the spreadsheet itself or would it have to run outside of it?
Ideal scenario would be to open a google spreadsheet, click on a button, Python script executes and data is filled in said spreadsheet.
Google GData (library with interfaces for all Google services) Python client:
https://code.google.com/p/gdata-python-client/
Spreadsheets API docs (linked from previous page):
https://developers.google.com/google-apps/spreadsheets/?csw=1
The question is from 2013. But still, as I was interested today by the answer, I though it could help some other people :
Google developed GScript, equivalent of VBA from Microsoft. I guess with this language you can easily scrape web data and include them into the sheet.
Otherwise, if you want to use Python, here is a great tutorial explaning how to use Google API v4:
https://developers.google.com/sheets/api/quickstart/python
The missing step: launching python script directly from the google sheet.
I hope it helps !
Yes, it is possible and this is how I am personally doing it so.
search for "doGet" and "doPost(e)
For example, how would I write a program that opens up facebook and posts a status? I'm trying to learn how to use python to duplicate normal user actions.
Facebook has an API you could use (it also has a module for Python) – this would be the "right way" for most of the use cases. Though it wouldn't be the same as "normal user actions", Facebook will distinct between a user using a browser to do things and an application using an API.
If you want to automate your software to browse a website, especially AJAX-y one like Facebook, I'd recommend you to look into Selenium – it's a browser automation framework that's available for many languages, including Python.
If you looking for "normal user actions", maybe you find this http://facebookbot.rubyforge.org/ useful. it's facebook-bot written in ruby. It's old, but the principles are still the same.
I'm not familiar with either BDP() or api. I'm just wondering if there is any easy and elegant way to implement this excel function with Bloomberg API? Thanks! (any language is fine although python is preferred)
What function? BDP is the api they provide to access data. I think the easiest solution for you to is to msg the helpdesk(hit the help key twice) and ask them for the api documentation. Its somewhere in bloomberg but I am not at my terminal right now, but the helpdesk not only can give you the documentation they can also show you code samples. You can also ask to speak to an API specialist, who can help you even more.
Most of the scripts my ex-employers fund were using python, so it def works.
For python, I have started a project to provide access to the bloomberg desktop api. Check it out and help out if you have some code - https://github.com/bpsmith/pybbg.
Im looking to write a new application in ruby/python which uses a feed from bloomberg and am stuck trying to find any documentation for using (or even setting up) Bloomberg Server API with either of these languages.
Does anyone have any good links to tutorials for this or maybe some boilerplate code to get set up? Or is it best to just stick to the three main supported languages?
The Bloomberg Open API (BLPAPI) v3.5 release now includes a native Python SDK.
http://www.openbloomberg.com/2012/11/21/open-api-blpapi-v3-5-x-released/
Did you check out some questions at SO on this. It might help you
Bloomberg API request timing out
Asynchronous data through Bloomberg's new data API (COM v3) with Python?
Resolver is an spreadsheet implementation in IronPython and has a very good integration for Bloomberg API
http://www.resolversystems.com/documentation/apidocs/MarketData_Bloomberg.html
Here is a simple Client access API which I wrote with the help of the mentioned links as well as some others. Not everything is implemented but it is a good start.
https://github.com/bpsmith/pybbg