macrobond 0.7.1
Pandas wrapper for the Macrobond API

# Macrobond
[![image](https://img.shields.io/pypi/v/macrobond.svg)](https://pypi.python.org/pypi/Macrobond)
[![Build Status](http://img.shields.io/travis/badges/badgerbadgerbadger.svg?style=flat-square)](https://travis-ci.org/badges/badgerbadgerbadger)
[![Coverage Status](http://img.shields.io/coveralls/badges/badgerbadgerbadger.svg?style=flat-square)](https://coveralls.io/r/badges/badgerbadgerbadger) 

A Pandas wrapper for the Macrobond API. Some of the methods require a Data+ license (https://www.macrobond.com/desktop-solutions)

Documentation from Macrobond can be found here:
* https://help.macrobond.com/technical-information/the-macrobond-api-for-python/
* https://help.macrobond.com/technical-information/common-metadata/

# Installation
The [macrobond-api-constants](https://pypi.org/project/macrobond-api-constants/) package is required:

    pip install macrobond_api_constants
    
Then simply install the latest version version of this package through Python package index (PyPI) as follows:
    
    pip install --upgrade macrobond

# A few examples

    from macrobond import c_macrobond
    import pandas as pd
    import numpy as np
    mb = c_macrobond.Macrobond()

### Fetch single time series
    
	df = mb.FetchOneSeries(ticker='usnaac0057')

### Fetch several time series

    df = mb.FetchSeries(ticker_list=['usnaac0057', 'senaac0067'])

### Time series and first revision

    df = mb.FetchOneSeriesWithRevisions(ticker='usnaac0057')

### Fetch several time series in the same currency (default: USD)

    df = mb.CreateUnifiedSeriesRequst(ticker_list=['usnaac0057', 'senaac0067'])

### Get all tickers for a concept

    ticker_list = mb.CreateSearchQuery(concept_filter='gdp_total')

#### The method above has a few more possibilities:
* Possible to narrow to specific regions/countries
* Possible to filter on specific frequencies  
* Possible to create a free text search query

### Free text search with filters:
Query below implies: 

_exclude: 'total return', exclude: 'price return', include: 'yield'.
Sweden as region. Daily frequency._

More details: https://help.macrobond.com/tutorials-training/2-finding-data/finding-data-in-search/search-terms-for-more-accurate-results/

    ticker_list = mb.CreateSearchQuery(**{'FreeText': '-total return, -price return, yield',
                                      'Frequency': 'daily',
                                      'RegionList': ['se']})

### Get summary of several time series

    df = mb.m_get_full_info(ticker_list=['usnaac0057', 'senaac0067'])

### Get the concept of a time series

    short_concept, long_concept = mb.m_series_concept(ticker='usnaac0057')

### Extract frequency for time series

    freq = mb.m_get_frequency(ticker='usnaac0057')

### Get title/description for a time series

    title = mb.m_get_title(ticker='usnaac0057')

### Get previous/next release date if it exist

    next_release = mb.m_release_date(ticker='usnaac0057', date_option='Next')

### Extract metadata for a series

    currency = mb.m_get_metadata(ticker='usnaac0057', option='Currency')

### Upload an in-house series

    ticker_list = ['ih:mb:priv:series1_example', 'ih:mb:priv:series2_example', 'ih:mb:priv:series3_example']
    description_list = ['Random series 1', 'Random series 2', 'Random series 3']
    category_list = ['Leading Indicators', 'Leading Indicators', 'Leading Indicators']
    region_list = ['us', 'se', 'jp']
    indx = pd.date_range(start='2010-01-01', end='2012-03-01', freq='D')
    data = np.random.normal(size=[len(indx), len(ticker_list)]).cumsum(axis=0)
    df = pd.DataFrame(index=indx, columns=ticker_list, data=data)
    mb.UploadOneOrMoreSeries(df, region_list, description_list, category_list)

# Disclaimer
Kindly note that this is an unofficial wrapper for the Macrobond API and the underlying structure could be subject to change at any point in time.

# LICENSE
MIT license. See the LICENSE file for details.

# RESPONSIBILITIES

The author of this software is not responsible for any indirect damages (foreseeable or unforeseeable), such as, if necessary, loss or alteration of or fraudulent access to data, accidental transmission of viruses or of any other harmful element, loss of profits or opportunities, the cost of replacement goods and services or the attitude and behavior of a third party.