Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 11 days 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-04T23:34:13.000Z (over 2 years ago)
- Last Synced: 2024-10-25T09:47:19.205Z (about 2 months 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
[![PyPI](https://img.shields.io/pypi/v/datasette-knightlab-timeline.svg)](https://pypi.org/project/datasette-knightlab-timeline/)
[![Changelog](https://img.shields.io/github/v/release/ashanan/datasette-knightlab-timeline?include_prereleases&label=changelog)](https://github.com/ashanan/datasette-knightlab-timeline/releases)
[![Tests](https://github.com/ashanan/datasette-knightlab-timeline/workflows/Test/badge.svg)](https://github.com/ashanan/datasette-knightlab-timeline/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](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/activateNow install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest