Skip to content

Instantly share code, notes, and snippets.

@simonw
Last active January 25, 2018 05:13
Show Gist options
  • Select an option

  • Save simonw/8725f9fc9759c9ecfb2a980ccb8e775d to your computer and use it in GitHub Desktop.

Select an option

Save simonw/8725f9fc9759c9ecfb2a980ccb8e775d to your computer and use it in GitHub Desktop.
Making a Datasette out of Freebase species data

Making a Datasette out of Freebase species data

I stumbled across an old export of Freebase data we used to build WildlifeNearYou:

https://github.com/devfort/wildlifenearyou/blob/master/freebase_data/data/organism_classification.tsv

It's a 6.89MB TSV file. Here's how I turned it into a Datasette instance at https://organisms.now.sh/

cd /tmp
wget https://raw.githubusercontent.com/devfort/wildlifenearyou/master/freebase_data/data/organism_classification.tsv
csvs-to-sqlite organism_classification.tsv organisms.db -s $'\t' \
    -c rank -f name -f scientific_name -f higher_classification \
    -c higher_classification -f lower_classifications
datasette publish now organisms.db \
    --source_url=https://github.com/devfort/wildlifenearyou/tree/master/freebase_data/data \
    --source=Freebase \
    --license="CC-BY" \
    --license_url="https://creativecommons.org/licenses/by/2.5/" \
    --title="Organisms and Species"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment