import json


def read_ghost_export(ghost_export_fname):
    """Read Ghost blog export file and return posts, tags and posttags."""
    with open(ghost_export_fname, 'r') as f:
        ghostdb = json.load(f)
    _posts = ghostdb['db'][0]['data']['posts']
    _tags = ghostdb['db'][0]['data']['tags']
    _posttags = ghostdb['db'][0]['data']['posts_tags']
    return _posts, _tags, _posttags