Skip to content

ashanan/datasette-knightlab-timeline

Repository files navigation

datasette-knightlab-timeline

PyPI Changelog Tests License

A Datasette plugin to create timelines using the TimelineJS library.

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-knightlab-timeline

Usage

Add a datasette-knightlab-timeline object to the metadata plugins section.

{
    "title": "This is the top-level title in metadata.json",
    "plugins": {
		"datasette-knightlab-timeline": {
			"databases": [{
				"database": "database_one",
				"query": "SELECT date_measured as start_date, text FROM measurement_event WHERE date_measured > (SELECT DATETIME('now', '-30 day'))"
			}, {
				"database": "inaturalist",
				"query": "SELECT created_at as start_date, 'Nature observation!  Observed ' || species_guess || '.' AS text FROM observations WHERE created_at > (SELECT DATETIME('now', '-30 day'))"
			}]
		}
    }
}

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-knightlab-timeline
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

About

Datasette plugin for creating timelines with TimelineJS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published