def test_writeANVLString(): elements = { 'issue': [{ 'content': '1' }], 'title': [{ 'content': 'Important Paper' }, { 'content': 'Another Paper' }] } anvl = mg.writeANVLString(elements, ordering=['title', 'issue']) assert anvl == ('title: Important Paper\n' 'title: Another Paper\n' 'issue: 1')
def generate_highwire_text(highwire_elements): """Convert highwire elements into an ANVL formatted string.""" highwire_dict = highwirepy2dict(highwire_elements) return writeANVLString(highwire_dict, HIGHWIRE_ORDER)
def generate_dc_txt(dc_dict): """Generate DC data as ANVL formatted string.""" return writeANVLString(dc_dict, DC_ORDER)