repos: 214299267
This data as json
id | node_id | name | full_name | private | owner | html_url | description | fork | created_at | updated_at | pushed_at | homepage | size | stargazers_count | watchers_count | language | has_issues | has_projects | has_downloads | has_wiki | has_pages | forks_count | archived | disabled | open_issues_count | license | topics | forks | open_issues | watchers | default_branch | permissions | temp_clone_token | organization | network_count | subscribers_count | readme | readme_html | allow_forking | visibility | is_template | template_repository | web_commit_signoff_required | has_discussions |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
214299267 | MDEwOlJlcG9zaXRvcnkyMTQyOTkyNjc= | datasette-render-timestamps | simonw/datasette-render-timestamps | 0 | 9599 | https://github.com/simonw/datasette-render-timestamps | Datasette plugin for rendering timestamps | 0 | 2019-10-10T22:50:50Z | 2020-10-17T11:09:42Z | 2020-03-22T17:57:17Z | 17 | 4 | 4 | Python | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | apache-2.0 | ["datasette", "datasette-plugin", "datasette-io"] | 1 | 0 | 4 | master | {"admin": false, "push": false, "pull": false} | 1 | 2 | # datasette-render-timestamps [](https://pypi.org/project/datasette-render-timestamps/) [](https://circleci.com/gh/simonw/datasette-render-timestamps) [](https://github.com/simonw/datasette-render-timestamps/blob/master/LICENSE) 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 - anything that would be a number of seconds from 5 years ago to 5 years in the future. These will then be rendered in a more readable format. ## Configuration You can disable automatic column detection in favour of explicitly listing the columns that you would like to render using [plugin configuration](https://datasette.readthedocs.io/en/stable/plugins.html#plugin-configuration) in a `metadata.json` file. Add a `"datasette-render-timestamps"` configuration block and use a `"columns"` key to list the columns you would like to treat as timestamp values: ```json { "plugins": { "datasette-render-timestamps": { "columns": ["created", "updated"] } } } ``` This will cause any `created` or `updated` columns in any table to be treated as timestamps and rendered. Save this to `metadata.json` and run datasette with the `--metadata` flag to load this configuration: datasette serve mydata.db --metadata metadata.json To disable automatic timestamp detection entirely, you can use `"columnns": []`. This configuration block can be used at the top level, or it can be applied just to specific databases or tables. Here's how to apply it to just the `entries` table in the `news.db` database: ```json { "databases": { "news": { "tables": { "entries": { "plugins": { "datasette-render-timestamps": { "columns": ["created", "updated"] } } } } } } } ``` And here's how to apply it to every `created` column in every table in the `news.db` database: ```json { "databases": { "news": { "plugins": { "datasette-render-timestamps": { "columns": ["created", "updated"] } } } } } ``` ### Customizing the date format 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 plugin configuration. Any format string supported by [strftime](http://strftime.org/) may be used. For example: ```json { "plugins": { "datasette-render-timestamps": { "format": "%Y-%m-%d-%H:%M:%S" } } } ``` | <div id="readme" class="md" data-path="README.md"><article class="markdown-body entry-content container-lg" itemprop="text"><h1><a id="user-content-datasette-render-timestamps" class="anchor" aria-hidden="true" href="#user-content-datasette-render-timestamps"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>datasette-render-timestamps</h1> <p><a href="https://pypi.org/project/datasette-render-timestamps/" rel="nofollow"><img src="https://camo.githubusercontent.com/6c9b69c5f6aca7ab8a2fbe0dd7b4ce1cca3a75f837750f3e7e7a55f9bd03b96f/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f6461746173657474652d72656e6465722d74696d657374616d70732e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/datasette-render-timestamps.svg" style="max-width:100%;"></a> <a href="https://circleci.com/gh/simonw/datasette-render-timestamps" rel="nofollow"><img src="https://camo.githubusercontent.com/8bf2320ca702efe91ed80467a992e0bd23b979894eaa4854bbc8affacbfaf8bb/68747470733a2f2f636972636c6563692e636f6d2f67682f73696d6f6e772f6461746173657474652d72656e6465722d74696d657374616d70732e7376673f7374796c653d737667" alt="CircleCI" data-canonical-src="https://circleci.com/gh/simonw/datasette-render-timestamps.svg?style=svg" style="max-width:100%;"></a> <a href="https://github.com/simonw/datasette-render-timestamps/blob/master/LICENSE"><img src="https://camo.githubusercontent.com/1698104e976c681143eb0841f9675c6f802bb7aa832afc0c7a4e719b1f3cf955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e737667" alt="License" data-canonical-src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" style="max-width:100%;"></a></p> <p>Datasette plugin for rendering timestamps.</p> <h2><a id="user-content-installation" class="anchor" aria-hidden="true" href="#user-content-installation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Installation</h2> <p>Install this plugin in the same environment as Datasette to enable this new functionality:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="pip install datasette-render-timestamps "><pre><code>pip install datasette-render-timestamps </code></pre></div> <p>The plugin will then look out for integer numbers that are likely to be timestamps - anything that would be a number of seconds from 5 years ago to 5 years in the future.</p> <p>These will then be rendered in a more readable format.</p> <h2><a id="user-content-configuration" class="anchor" aria-hidden="true" href="#user-content-configuration"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Configuration</h2> <p>You can disable automatic column detection in favour of explicitly listing the columns that you would like to render using <a href="https://datasette.readthedocs.io/en/stable/plugins.html#plugin-configuration" rel="nofollow">plugin configuration</a> in a <code>metadata.json</code> file.</p> <p>Add a <code>"datasette-render-timestamps"</code> configuration block and use a <code>"columns"</code> key to list the columns you would like to treat as timestamp values:</p> <div class="highlight highlight-source-json position-relative" data-snippet-clipboard-copy-content="{ "plugins": { "datasette-render-timestamps": { "columns": ["created", "updated"] } } } "><pre>{ <span class="pl-s"><span class="pl-pds">"</span>plugins<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>datasette-render-timestamps<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>columns<span class="pl-pds">"</span></span>: [<span class="pl-s"><span class="pl-pds">"</span>created<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>updated<span class="pl-pds">"</span></span>] } } }</pre></div> <p>This will cause any <code>created</code> or <code>updated</code> columns in any table to be treated as timestamps and rendered.</p> <p>Save this to <code>metadata.json</code> and run datasette with the <code>--metadata</code> flag to load this configuration:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="datasette serve mydata.db --metadata metadata.json "><pre><code>datasette serve mydata.db --metadata metadata.json </code></pre></div> <p>To disable automatic timestamp detection entirely, you can use <code>"columnns": []</code>.</p> <p>This configuration block can be used at the top level, or it can be applied just to specific databases or tables. Here's how to apply it to just the <code>entries</code> table in the <code>news.db</code> database:</p> <div class="highlight highlight-source-json position-relative" data-snippet-clipboard-copy-content="{ "databases": { "news": { "tables": { "entries": { "plugins": { "datasette-render-timestamps": { "columns": ["created", "updated"] } } } } } } } "><pre>{ <span class="pl-s"><span class="pl-pds">"</span>databases<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>news<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>tables<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>entries<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>plugins<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>datasette-render-timestamps<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>columns<span class="pl-pds">"</span></span>: [<span class="pl-s"><span class="pl-pds">"</span>created<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>updated<span class="pl-pds">"</span></span>] } } } } } } }</pre></div> <p>And here's how to apply it to every <code>created</code> column in every table in the <code>news.db</code> database:</p> <div class="highlight highlight-source-json position-relative" data-snippet-clipboard-copy-content="{ "databases": { "news": { "plugins": { "datasette-render-timestamps": { "columns": ["created", "updated"] } } } } } "><pre>{ <span class="pl-s"><span class="pl-pds">"</span>databases<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>news<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>plugins<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>datasette-render-timestamps<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>columns<span class="pl-pds">"</span></span>: [<span class="pl-s"><span class="pl-pds">"</span>created<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>updated<span class="pl-pds">"</span></span>] } } } } }</pre></div> <h3><a id="user-content-customizing-the-date-format" class="anchor" aria-hidden="true" href="#user-content-customizing-the-date-format"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Customizing the date format</h3> <p>The default format is <code>%B %d, %Y - %H:%M:%S UTC</code> which renders for example: <code>October 10, 2019 - 07:18:29 UTC</code>. If you want another format, the date format can be customized using plugin configuration. Any format string supported by <a href="http://strftime.org/" rel="nofollow">strftime</a> may be used. For example:</p> <div class="highlight highlight-source-json position-relative" data-snippet-clipboard-copy-content="{ "plugins": { "datasette-render-timestamps": { "format": "%Y-%m-%d-%H:%M:%S" } } } "><pre>{ <span class="pl-s"><span class="pl-pds">"</span>plugins<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>datasette-render-timestamps<span class="pl-pds">"</span></span>: { <span class="pl-s"><span class="pl-pds">"</span>format<span class="pl-pds">"</span></span>: <span class="pl-s"><span class="pl-pds">"</span>%Y-%m-%d-%H:%M:%S<span class="pl-pds">"</span></span> } } }</pre></div> </article></div> |
Links from other tables
- 4 rows from repo in releases