Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 1.98 KB

README.md

File metadata and controls

59 lines (46 loc) · 1.98 KB

Using datasette to browse a CLDF dataset

Basics

The cldf command, which can be installed with the Python package pycldf provides functionality to load any CLDF dataset into a SQLite database. datasette is a powerful tool for exploring data in SQLite database.

Thus, exploring CLDF with datasette is as simple as running

pip install pycldf
pip install datasette
cldf createdb PATH/TO/CLDF/metadata.json PATH/TO/dataset.sqlite
datasette PATH/TO/dataset.sqlite

and visiting http://localhost:8001 in your browser.

Customization

But datasette provides a full-featured plugin system, which allows adding custom visualisations for the data. This can be paired with CLDF's metadata to extend the usability of datasette. Geographic coordinates for languages - for example - are well specified in CLDF, thus can generically be made available for datasette's cluster map plugin:

  1. Install the plugin:
    pip install datasette-cluster-map
  2. Write a datasette configuration file, with the following content:
    {
        "title": "",
        "plugins": {
            "datasette-cluster-map": {
                "latitude_column": "cldf_latitude",
                "longitude_column": "cldf_longitude"
            }
        }
    }
    This will make sure the appropriate columns in the SQLite database are detected.
  3. Run datasette with the configuration:
    datasette PATH/TO/dataset.sqlite -m PATH/TO/datasette_metadata.json

Navigating to the LanguageTable of the database in datasette's interface will show a map with clusters of language locations.

datasette-cldf

A datasette setup which is even more tuned to CLDF data is available with the datasette-cldf Python package.