Skip to content

Instantly share code, notes, and snippets.

@tucotuco
Last active December 18, 2015 15:59
Show Gist options
  • Save tucotuco/5808207 to your computer and use it in GitHub Desktop.
Save tucotuco/5808207 to your computer and use it in GitHub Desktop.
Darwin Core record type function
def record_type(rec):
if rec.has_key('type'):
if rec['type'].lower() == 'physicalobject':
return 'specimen'
return 'observation'
if rec.has_key('basisofrecord'):
if 'spec' in rec[basisofrecord].lower():
return 'specimen'
return 'observation'
return 'unknown'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment