https://github.com/ashanan/datasette-knightlab-timeline
Datasette plugin for creating timelines with TimelineJS
https://github.com/ashanan/datasette-knightlab-timeline
datasette-plugin timelinejs
Last synced: 3 months ago
JSON representation
Datasette plugin for creating timelines with TimelineJS
- Host: GitHub
- URL: https://github.com/ashanan/datasette-knightlab-timeline
- Owner: ashanan
- License: apache-2.0
- Created: 2022-06-12T22:18:54.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-04T23:34:13.000Z (about 4 years ago)
- Last Synced: 2025-03-30T23:43:30.137Z (over 1 year ago)
- Topics: datasette-plugin, timelinejs
- Language: Python
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# datasette-knightlab-timeline
[](https://pypi.org/project/datasette-knightlab-timeline/)
[](https://github.com/ashanan/datasette-knightlab-timeline/releases)
[](https://github.com/ashanan/datasette-knightlab-timeline/actions?query=workflow%3ATest)
[](https://github.com/ashanan/datasette-knightlab-timeline/blob/main/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.
```json
{
"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