esturdivant-usgs / science-base-automation

Automating large USGS ScienceBase data releases
4 stars 2 forks source link

Add the ability to change the suggested citation in the othercit field #26

Closed esturdivant-usgs closed 6 years ago

esturdivant-usgs commented 6 years ago

Assuming that the suggested citation is already provided, the DOI needs to be updated.

This should work, but requires the user inputting a lot of text, including the DOI that is input above.

new_othercit = """<othercit>
               Suggested citation: Sturdivant, E.J., {}, Title: U.S. Geological Survey data 
                       release, https://doi.org/{}.
                </othercit>""".format(pubdate, dr_doi)

metadata_replacements = {'./idinfo/citation/citeinfo':new_distrib}

Another option is to find and replace such as

find_and_replace = {'https://doi.org/{}'.format(dr_doi): 
['https://doi.org/10.5066/xxx', 'https://doi.org/10.5066/xxxx', 
'https://doi.org/10.5066/xxxxx', 'https://doi.org/xxx']}

And another option is to automatically create the citation, but chances for success seem slim. We could get it from the parent page...