Skip to content

Instantly share code, notes, and snippets.

View nickdos's full-sized avatar

Nick dos Remedios nickdos

View GitHub Profile
@nickdos
nickdos / Dwc_terms_biocache.sh
Last active May 14, 2020 09:29
Shell scripts for biocache using JQ
# find all DwC terms in index/fields
curl -s https://biocache-ws.ala.org.au/ws/index/fields | jq -r '.[] | select(.dwcTerm != null) | .dwcTerm '
curl -s "https://biocache-ws.ala.org.au/ws/index/fields" | jq -r '.[] | select(.dwcTerm != null) | "\(.name)|\(.dwcTerm)" '
@nickdos
nickdos / caab_names_images_merge.py
Last active May 26, 2020 02:46
CAAB names and images from ALA
import urllib.request
import json
import csv
# pull out names, imageID, image URL, etc., from ALA occurrences API
url = "https://biocache-ws.ala.org.au/ws/occurrences/search?q=data_resource_uid:dr660&pageSize=5000"
req = urllib.request.Request(url)
r = urllib.request.urlopen(req).read()
content = json.loads(r.decode('utf-8'))
counter = 0