def datacite_metadata_for_node(node, doi, pretty_print=False):
 def format_contrib(contributor):
  return u'{}, {}'.format(contributor.family_name, contributor.given_name)
 creators = [format_contrib(each) for each in node.visible_contributors]
 return datacite_metadata(doi=doi, title=node.title, creators=creators, publisher='Open Science Framework', publication_year=getattr((node.registered_date or node.date_created), 'year'), pretty_print=pretty_print)

def datacite_metadata_for_node ( node , doi , pretty_print = False ) : def format_contrib ( contributor ) : return u'{}, {}' . format ( contributor . family_name , contributor . given_name ) creators = [ format_contrib ( each ) for each in node . visible_contributors ] return datacite_metadata ( doi = doi , title = node . title , creators = creators , publisher = 'Open Science Framework' , publication_year = getattr ( ( node . registered_date or node . date_created ) , 'year' ) , pretty_print = pretty_print )
return the datacite metadata xml document for a given node as a string .