news article background image
2016-04-18App features

Thoughts from The Dev Team

On hard choices, simplifying your workflow, and our new Python (API)


Welcome to the first in a series of monthly posts from the product development team. In these posts we’ll be giving you a look at what we’ve been working on here in Gothenburg, Sweden, as well as general ruminations from our department. I guess it will be mostly me, Thomas Olsson, writing these posts, but occasionally someone else from the team might join in.


K.I.S.S.

We think that the Macrobond application is the best tool to use for pretty much everything our users need to do (not so strange, when you consider that we built it that way). That being said, there are some users who have not, yet, come to realize this, and so they continue to want to use other tools! Oh, the irony…

Allow me to clarify. Our philosophy is to offer the most commonly used statistical functions in an easy-to-use way. This sometimes means that we may not offer all the possible settings for certain analyses.

On purpose.

And with good reason! By leaving out features that are rarely used, we can make a more user-friendly interface. Which means more time for our users to do what they really want to be doing, instead of trying to wrestle with an unruly tool. Deciding what to leave out however, that is one of the most difficult parts of building a product. (Whatever else can be said about the man, in my view this was one of the true strengths of Steve Jobs, and essential to the success of the first iPhone. He dared to leave things out.)

What if you need more options?

That’s where APIs come in. What an API (Application Programming Interface) does is to make different applications collaborate. To give you an example let’s compare a workflow with and without an API. Let’s say you’re working in Macrobond and find some data you would like to put through EViews.

Without an API:

  1. Download the data from Macrobond
  2. Save it in Excel
  3. Open EViews
  4. Upload the data from the Excel file

With an API:

  1. Open EViews

With an API you can access the Macrobond data in EViews directly.

For a long time now, we’ve offered users the possibility to integrate Excel, EViews, and MATLAB into their workflow in the Macrobond application, via APIs for these programs. So those users who prefer to stick to the tools they know, or those that need features that aren’t widely used by their peers, can choose what works best for them. If you’re using Macrobond in conjunction with these tools and don’t know how to make use of these APIs, read this.


Macrobond + Python

Now we have added an API for Python to that list. Python is a programming platform, popular amongst financial analysts for powerful libraries like NumPy, SciPy and Pandas.

If you’re a fan of Python (the platform, not the British comedy ensemble, although naturally these things are not mutually exclusive) you’ll be pleased to know, when running Macrobond on the same computer as Python, you can:

  • Use any time series, including values, dates, and metadata, in Python
  • Convert a set of time series to a common calendar and optionally, a common currency
  • Fill in missing values in a few different ways
  • Upload your own series to your in-house database in Macrobond, which can then be used in the application and even shared with others

Downloading a time series and printing the values can be done with just a few lines of code:


import win32com.client
c = win32com.client.Dispatch("Macrobond.Connection")
d = c.Database
s = d.FetchOneSeries("usgdp")
print (s.Values)


The Facts

The API is included in the Macrobond application from version 1.15.88.

In the documentation on our help site you’ll find information about all the possibilities you have with the Python API, as well as many examples: https://help.macrobond.com/add-ins/macrobond-python-api/