Skip to content

Instantly share code, notes, and snippets.

@simonw
Last active August 30, 2023 12:52
Show Gist options
  • Select an option

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

Select an option

Save simonw/daab211baeebdffba603ca86340ae296 to your computer and use it in GitHub Desktop.

Data from https://www.speechinteraction.org/TNG/index.html loaded into SQLite.

curl 'https://www.speechinteraction.org/TNG/teaearlgreyhotdataset.json' | python3 -c '
import sys
import json

data = json.load(sys.stdin)
processed = []

for episode, moments in data.items():
    for timestamp, details in moments.items():
        processed.append(dict(details, episode=episode, timestamp=int(timestamp)))

print(json.dumps(processed, indent=2))
' | sqlite-utils insert startrek.db interactions -