home / content / repos

repos: 390535500

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
390535500 MDEwOlJlcG9zaXRvcnkzOTA1MzU1MDA= datasette-remote-metadata simonw/datasette-remote-metadata 0 9599 https://github.com/simonw/datasette-remote-metadata Periodically refresh Datasette metadata from a remote URL 0 2021-07-28T23:17:19Z 2021-12-13T19:40:51Z 2021-12-13T19:40:48Z   8 3 3 Python 1 1 1 1 0 0 0 0 0 apache-2.0 [] 0 0 3 main {"admin": false, "maintain": false, "push": false, "triage": false, "pull": false}     0 2 # datasette-remote-metadata [![PyPI](https://img.shields.io/pypi/v/datasette-remote-metadata.svg)](https://pypi.org/project/datasette-remote-metadata/) [![Changelog](https://img.shields.io/github/v/release/simonw/datasette-remote-metadata?include_prereleases&label=changelog)](https://github.com/simonw/datasette-remote-metadata/releases) [![Tests](https://github.com/simonw/datasette-remote-metadata/workflows/Test/badge.svg)](https://github.com/simonw/datasette-remote-metadata/actions?query=workflow%3ATest) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-remote-metadata/blob/main/LICENSE) Periodically refresh Datasette metadata from a remote URL ## Installation Install this plugin in the same environment as Datasette. $ datasette install datasette-remote-metadata ## Usage Add the following to your `metadata.json`: ```json { "plugins": { "datasette-remote-metadata": { "url": "https://example.com/remote-metadata.yml" } } } ``` The plugin will fetch the specified metadata from that URL at startup and combine it with any existing metadata. You can use a URL to either a JSON file or a YAML file. It will periodically refresh that metadata - by default every 30 seconds, unless you specify an alternative `"ttl"` value in the plugin configuration. ## Configuration Available configuration options are as follows: - `"url"` - the URL to retrieve remote metadata from. Can link to a JSON or a YAML file. - `"ttl"` - integer value in secords: how frequently should the script check for fresh metadata. Defaults to 30 seconds. - `"headers"` - a dictionary of additional request headers to send. - `"cachebust"` - if true, a random `?0.29508` value will be added to the query string of the remote metadata to bust any intermediary caches. This example `metadata.json` configuration refreshes every 10 seconds, uses cache busting and sends an `Authorization: Bearer xyz` header with the request: ```json { "plugins": { "datasette-remote-metadata": { "url": "https://example.com/remote-metadata.yml", "ttl": 10, "cachebust": true, "headers": { "Authorization": "Bearer xyz" } } } } ``` This example if you are using `metadata.yaml` for configuration: ```yaml plugins: datasette-remote-metadata: url: https://example.com/remote-metadata.yml ttl: 10 cachebust: true headers: Authorization: Bearer xyz ``` ## Development To set up this plugin locally, first checkout the code. Then create a new virtual environment: cd datasette-remote-metadata python3 -mvenv venv source venv/bin/activate Or if you are using `pipenv`: pipenv shell Now install the dependencies and test dependencies: pip install -e '.[test]' To run the tests: pytest <div id="readme" class="md" data-path="README.md"><article class="markdown-body entry-content container-lg" itemprop="text"><h1 dir="auto"><a id="user-content-datasette-remote-metadata" class="anchor" aria-hidden="true" href="#user-content-datasette-remote-metadata"><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-remote-metadata</h1> <p dir="auto"><a href="https://pypi.org/project/datasette-remote-metadata/" rel="nofollow"><img src="https://camo.githubusercontent.com/88715eda95713112087b759d9348f413cf7421760dbf9dc75a891f603077bb02/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f6461746173657474652d72656d6f74652d6d657461646174612e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/datasette-remote-metadata.svg" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-remote-metadata/releases"><img src="https://camo.githubusercontent.com/81743aaae3ae2fa6d977f38bae18d79b191a53725378e4a945833f29a7d75bb1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73696d6f6e772f6461746173657474652d72656d6f74652d6d657461646174613f696e636c7564655f70726572656c6561736573266c6162656c3d6368616e67656c6f67" alt="Changelog" data-canonical-src="https://img.shields.io/github/v/release/simonw/datasette-remote-metadata?include_prereleases&amp;label=changelog" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-remote-metadata/actions?query=workflow%3ATest"><img src="https://github.com/simonw/datasette-remote-metadata/workflows/Test/badge.svg" alt="Tests" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-remote-metadata/blob/main/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 dir="auto">Periodically refresh Datasette metadata from a remote URL</p> <h2 dir="auto"><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 dir="auto">Install this plugin in the same environment as Datasette.</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="$ datasette install datasette-remote-metadata"><pre><code>$ datasette install datasette-remote-metadata </code></pre></div> <h2 dir="auto"><a id="user-content-usage" class="anchor" aria-hidden="true" href="#user-content-usage"><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>Usage</h2> <p dir="auto">Add the following to your <code>metadata.json</code>:</p> <div class="highlight highlight-source-json position-relative overflow-auto" data-snippet-clipboard-copy-content="{ &quot;plugins&quot;: { &quot;datasette-remote-metadata&quot;: { &quot;url&quot;: &quot;https://example.com/remote-metadata.yml&quot; } } }"><pre>{ <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-remote-metadata"</span>: { <span class="pl-ent">"url"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://example.com/remote-metadata.yml<span class="pl-pds">"</span></span> } } }</pre></div> <p dir="auto">The plugin will fetch the specified metadata from that URL at startup and combine it with any existing metadata. You can use a URL to either a JSON file or a YAML file.</p> <p dir="auto">It will periodically refresh that metadata - by default every 30 seconds, unless you specify an alternative <code>"ttl"</code> value in the plugin configuration.</p> <h2 dir="auto"><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 dir="auto">Available configuration options are as follows:</p> <ul dir="auto"> <li><code>"url"</code> - the URL to retrieve remote metadata from. Can link to a JSON or a YAML file.</li> <li><code>"ttl"</code> - integer value in secords: how frequently should the script check for fresh metadata. Defaults to 30 seconds.</li> <li><code>"headers"</code> - a dictionary of additional request headers to send.</li> <li><code>"cachebust"</code> - if true, a random <code>?0.29508</code> value will be added to the query string of the remote metadata to bust any intermediary caches.</li> </ul> <p dir="auto">This example <code>metadata.json</code> configuration refreshes every 10 seconds, uses cache busting and sends an <code>Authorization: Bearer xyz</code> header with the request:</p> <div class="highlight highlight-source-json position-relative overflow-auto" data-snippet-clipboard-copy-content="{ &quot;plugins&quot;: { &quot;datasette-remote-metadata&quot;: { &quot;url&quot;: &quot;https://example.com/remote-metadata.yml&quot;, &quot;ttl&quot;: 10, &quot;cachebust&quot;: true, &quot;headers&quot;: { &quot;Authorization&quot;: &quot;Bearer xyz&quot; } } } }"><pre>{ <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-remote-metadata"</span>: { <span class="pl-ent">"url"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://example.com/remote-metadata.yml<span class="pl-pds">"</span></span>, <span class="pl-ent">"ttl"</span>: <span class="pl-c1">10</span>, <span class="pl-ent">"cachebust"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"headers"</span>: { <span class="pl-ent">"Authorization"</span>: <span class="pl-s"><span class="pl-pds">"</span>Bearer xyz<span class="pl-pds">"</span></span> } } } }</pre></div> <p dir="auto">This example if you are using <code>metadata.yaml</code> for configuration:</p> <div class="highlight highlight-source-yaml position-relative overflow-auto" data-snippet-clipboard-copy-content="plugins: datasette-remote-metadata: url: https://example.com/remote-metadata.yml ttl: 10 cachebust: true headers: Authorization: Bearer xyz"><pre><span class="pl-ent">plugins</span>: <span class="pl-ent">datasette-remote-metadata</span>: <span class="pl-ent">url</span>: <span class="pl-s">https://example.com/remote-metadata.yml</span> <span class="pl-ent">ttl</span>: <span class="pl-c1">10</span> <span class="pl-ent">cachebust</span>: <span class="pl-c1">true</span> <span class="pl-ent">headers</span>: <span class="pl-ent">Authorization</span>: <span class="pl-s">Bearer xyz</span></pre></div> <h2 dir="auto"><a id="user-content-development" class="anchor" aria-hidden="true" href="#user-content-development"><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>Development</h2> <p dir="auto">To set up this plugin locally, first checkout the code. Then create a new virtual environment:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="cd datasette-remote-metadata python3 -mvenv venv source venv/bin/activate"><pre><code>cd datasette-remote-metadata python3 -mvenv venv source venv/bin/activate </code></pre></div> <p dir="auto">Or if you are using <code>pipenv</code>:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="pipenv shell"><pre><code>pipenv shell </code></pre></div> <p dir="auto">Now install the dependencies and test dependencies:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="pip install -e '.[test]'"><pre><code>pip install -e '.[test]' </code></pre></div> <p dir="auto">To run the tests:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="pytest"><pre><code>pytest </code></pre></div> </article></div> 1 public 0      

Links from other tables

  • 2 rows from repo in releases
Powered by Datasette · Queries took 1.521ms