Datasette plugin for rendering timestamps
Project description
datasette-render-timestamps
Datasette plugin for rendering timestamps.
Installation
Install this plugin in the same environment as Datasette to enable this new functionality:
pip install datasette-render-timestamps
The plugin will then look out for integer numbers that are likely to be timestamps (defaults to anything that would be a number of seconds from 5 years ago to 5 years in the future - this will be configurable eventually).
These will then be rendered in a more readable format.
Configuration
The default format is %B %d, %Y - %H:%M:%S UTC
which renders for example: October 10, 2019 - 07:18:29 UTC
. If you want another format, the date format can be customized using a plugin configuration in a metadata.json
file. Any format string supported by strftime may be used. For example:
{
"title": "Regular metadata keys can go here too",
"plugins": {
"datasette-render-timestamps": {
"format": "%Y-%m-%d-%H:%M:%S"
}
}
}
Run datasette with the -m
flag to load the metadata config:
datasette serve mydata.db -m metadata.json
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for datasette_render_timestamps-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c31236451a56911a3e4e533178c966a56c80da7a727fc6aa081527d00840768e |
|
MD5 | 604e9b2348502514ddfec5488b597724 |
|
BLAKE2b-256 | 79a6c183428f7fb45834619061a8ee030e113cefbd98424f9aa29810e4219158 |