Skip to content

Instantly share code, notes, and snippets.

@tucotuco
Created June 18, 2013 19:04
Show Gist options
  • Save tucotuco/5808263 to your computer and use it in GitHub Desktop.
Save tucotuco/5808263 to your computer and use it in GitHub Desktop.
Darwin Core media detector.
def has_media(rec):
if rec.has_key('associatedmedia'):
return True
if rec.has_key('type'):
if rec['type'].lower()=='sound':
return True
if 'image' in rec['type'].lower():
return True
return False
if rec.has_key('basisofrecord'):
if rec['basisofrecord'].lower()=='machineobservation':
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment