def write(filename, data):
    """
    Create a new BibTeX file.

    :param filename: The name of the BibTeX file to write.
    :param data: A ``bibtexparser.BibDatabase`` object.
    """
    with open(filename, 'w') as fh:
        fh.write(bibdatabase2bibtex(data))