home / content / repos

repos: 489156146

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
489156146 R_kgDOHSfuMg datasette-upload-dbs simonw/datasette-upload-dbs 0 9599 https://github.com/simonw/datasette-upload-dbs Upload SQLite database files to Datasette 0 2022-05-05T23:36:51Z 2022-05-17T16:38:00Z 2022-09-09T16:23:13Z   93 5 5 Python 1 1 1 1 0 0 0 0 1 apache-2.0 [] 0 1 5 main {"admin": false, "maintain": false, "push": false, "triage": false, "pull": false}     0 2 # datasette-upload-dbs [![PyPI](https://img.shields.io/pypi/v/datasette-upload-dbs.svg)](https://pypi.org/project/datasette-upload-dbs/) [![Changelog](https://img.shields.io/github/v/release/simonw/datasette-upload-dbs?include_prereleases&label=changelog)](https://github.com/simonw/datasette-upload-dbs/releases) [![Tests](https://github.com/simonw/datasette-upload-dbs/workflows/Test/badge.svg)](https://github.com/simonw/datasette-upload-dbs/actions?query=workflow%3ATest) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-upload-dbs/blob/main/LICENSE) Upload SQLite database files to Datasette ## Installation Install this plugin in the same environment as Datasette. datasette install datasette-upload-dbs ## Configuration This plugin requires you to configure a directory in which uploaded files will be stored. On startup, Datasette will automatically load any SQLite files that it finds in that directory. This means it is safe to restart your server in between file uploads. To configure the directory as `/home/datasette/uploads`, add this to a `metadata.yml` configuration file: ```yaml plugins: datasette-upload-dbs: directory: /home/datasette/uploads ``` Or if you are using `metadata.json`: ```json { "plugins": { "datasette-upload-dbs": { "directory": "/home/datasette/uploads" } } } ``` You can use `"."` for the current folder when the server starts, or `"uploads"` for a folder relative to that folder. The folder will be created on startup if it does not already exist. Then start Datasette like this: datasette -m metadata.yml ## Usage Only users with the `upload-dbs` permission will be able to upload files. The `root` user has this permission by default - other users can be granted access using permission plugins, see the [Permissions](https://docs.datasette.io/en/stable/authentication.html#permissions) documentation for details. To start Datasette as the root user, run this: datasette -m metadata.yml --root And follow the link that is displayd on the console. If a user has that permission they will see an "Upload database" link in the navigation menu. This will take them to `/-/upload-dbs` where they will be able to upload database files, by selecting them or by dragging them onto the drop area. ![Animated demo showing a file being dropped onto a box, then uploading and redirecting to the database page](https://github.com/simonw/datasette-upload-dbs/raw/main/upload-demo.gif) ## Development To set up this plugin locally, first checkout the code. Then create a new virtual environment: cd datasette-upload-dbs python3 -m venv venv source venv/bin/activate 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-upload-dbs" class="anchor" aria-hidden="true" href="#user-content-datasette-upload-dbs"><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-upload-dbs</h1> <p dir="auto"><a href="https://pypi.org/project/datasette-upload-dbs/" rel="nofollow"><img src="https://camo.githubusercontent.com/dc98cd1fbc11a52c3610a10dd294832a4489aa3366a5e88b61ab3b7144bf7425/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f6461746173657474652d75706c6f61642d6462732e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/datasette-upload-dbs.svg" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-upload-dbs/releases"><img src="https://camo.githubusercontent.com/c00a952891cccd5b0a084a4a8aebf0f38a89669c5e7769a926b45fcaa5fa33bf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73696d6f6e772f6461746173657474652d75706c6f61642d6462733f696e636c7564655f70726572656c6561736573266c6162656c3d6368616e67656c6f67" alt="Changelog" data-canonical-src="https://img.shields.io/github/v/release/simonw/datasette-upload-dbs?include_prereleases&amp;label=changelog" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-upload-dbs/actions?query=workflow%3ATest"><img src="https://github.com/simonw/datasette-upload-dbs/workflows/Test/badge.svg" alt="Tests" style="max-width: 100%;"></a> <a href="https://github.com/simonw/datasette-upload-dbs/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">Upload SQLite database files to Datasette</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 notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="datasette install datasette-upload-dbs"><pre class="notranslate"><code>datasette install datasette-upload-dbs </code></pre></div> <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">This plugin requires you to configure a directory in which uploaded files will be stored.</p> <p dir="auto">On startup, Datasette will automatically load any SQLite files that it finds in that directory. This means it is safe to restart your server in between file uploads.</p> <p dir="auto">To configure the directory as <code>/home/datasette/uploads</code>, add this to a <code>metadata.yml</code> configuration file:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="plugins: datasette-upload-dbs: directory: /home/datasette/uploads"><pre><span class="pl-ent">plugins</span>: <span class="pl-ent">datasette-upload-dbs</span>: <span class="pl-ent">directory</span>: <span class="pl-s">/home/datasette/uploads</span></pre></div> <p dir="auto">Or if you are using <code>metadata.json</code>:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;plugins&quot;: { &quot;datasette-upload-dbs&quot;: { &quot;directory&quot;: &quot;/home/datasette/uploads&quot; } } }"><pre>{ <span class="pl-ent">"plugins"</span>: { <span class="pl-ent">"datasette-upload-dbs"</span>: { <span class="pl-ent">"directory"</span>: <span class="pl-s"><span class="pl-pds">"</span>/home/datasette/uploads<span class="pl-pds">"</span></span> } } }</pre></div> <p dir="auto">You can use <code>"."</code> for the current folder when the server starts, or <code>"uploads"</code> for a folder relative to that folder. The folder will be created on startup if it does not already exist.</p> <p dir="auto">Then start Datasette like this:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="datasette -m metadata.yml"><pre class="notranslate"><code>datasette -m metadata.yml </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">Only users with the <code>upload-dbs</code> permission will be able to upload files. The <code>root</code> user has this permission by default - other users can be granted access using permission plugins, see the <a href="https://docs.datasette.io/en/stable/authentication.html#permissions" rel="nofollow">Permissions</a> documentation for details.</p> <p dir="auto">To start Datasette as the root user, run this:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="datasette -m metadata.yml --root"><pre class="notranslate"><code>datasette -m metadata.yml --root </code></pre></div> <p dir="auto">And follow the link that is displayd on the console.</p> <p dir="auto">If a user has that permission they will see an "Upload database" link in the navigation menu.</p> <p dir="auto">This will take them to <code>/-/upload-dbs</code> where they will be able to upload database files, by selecting them or by dragging them onto the drop area.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://github.com/simonw/datasette-upload-dbs/raw/main/upload-demo.gif"><img src="https://github.com/simonw/datasette-upload-dbs/raw/main/upload-demo.gif" alt="Animated demo showing a file being dropped onto a box, then uploading and redirecting to the database page" data-animated-image="" style="max-width: 100%;"></a></p> <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 notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cd datasette-upload-dbs python3 -m venv venv source venv/bin/activate"><pre class="notranslate"><code>cd datasette-upload-dbs python3 -m venv venv source venv/bin/activate </code></pre></div> <p dir="auto">Now install the dependencies and test dependencies:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pip install -e '.[test]'"><pre class="notranslate"><code>pip install -e '.[test]' </code></pre></div> <p dir="auto">To run the tests:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pytest"><pre class="notranslate"><code>pytest </code></pre></div> </article></div> 1 public 0   0  

Links from other tables

  • 3 rows from repo in releases
Powered by Datasette · Queries took 1.184ms