repos: 175550127
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
175550127 | MDEwOlJlcG9zaXRvcnkxNzU1NTAxMjc= | yaml-to-sqlite | simonw/yaml-to-sqlite | 0 | 9599 | https://github.com/simonw/yaml-to-sqlite | Utility for converting YAML files to SQLite | 0 | 2019-03-14T04:49:08Z | 2021-06-13T09:04:40Z | 2021-06-13T04:45:52Z | 19 | 36 | 36 | Python | 1 | 1 | 1 | 1 | 0 | 2 | 0 | 0 | 0 | apache-2.0 | ["yaml", "sqlite", "datasette-io", "datasette-tool"] | 2 | 0 | 36 | main | {"admin": false, "push": false, "pull": false} | 2 | 1 | # yaml-to-sqlite [](https://pypi.org/project/yaml-to-sqlite/) [](https://github.com/simonw/yaml-to-sqlite/releases) [](https://github.com/simonw/yaml-to-sqlite/actions?query=workflow%3ATest) [](https://github.com/simonw/yaml-to-sqlite/blob/main/LICENSE) Load the contents of a YAML file into a SQLite database table. ``` $ yaml-to-sqlite --help Usage: yaml-to-sqlite [OPTIONS] DB_PATH TABLE YAML_FILE Convert YAML files to SQLite Options: --version Show the version and exit. --pk TEXT Column to use as a primary key --single-column TEXT If YAML file is a list of values, populate this column --help Show this message and exit. ``` ## Usage Given a `news.yml` file containing the following: ```yaml - date: 2021-06-05 body: |- [Datasette 0.57](https://docs.datasette.io/en/stable/changelog.html#v0-57) is out with an important security patch. - date: 2021-05-10 body: |- [Django SQL Dashboard](https://simonwillison.net/2021/May/10/django-sql-dashboard/) is a new tool that brings a useful authenticated subset of Datasette to Django projects that are built on top of PostgreSQL. ``` Running this command: ```bash $ yaml-to-sqlite news.db stories news.yml ``` Will create a database file with this schema: ```bash $ sqlite-utils schema news.db CREATE TABLE [stories] ( [date] TEXT, [body] TEXT ); ``` The `--pk` option can be used to set a column as the primary key for the table: ```bash $ yaml-to-sqlite news.db stories news.yml --pk date $ sqlite-utils schema news.db CREATE TABLE [stories] ( [date] TEXT PRIMARY KEY, [body] TEXT ); ``` ## Single column YAML lists The `--single-column` option can be used when the YAML file is a list of values, for example a file called `dogs.yml` containing the following: ```yaml - Cleo - Pancakes - Nixie ``` Running this command: ```bash $ yaml-to-sqlite dogs.db dogs.yaml --single-column=name ``` Will create a single `dogs` table with a single `name` column that is the primary key: ```bash $ sqlite-utils schema dogs.db CREATE TABLE [dogs] ( [name] TEXT PRIMARY KEY ); $ sqlite-utils dogs.db 'select * from dogs' -t name -------- Cleo Pancakes Nixie ``` | <div id="readme" class="md" data-path="README.md"><article class="markdown-body entry-content container-lg" itemprop="text"><h1><a id="user-content-yaml-to-sqlite" class="anchor" aria-hidden="true" href="#user-content-yaml-to-sqlite"><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>yaml-to-sqlite</h1> <p><a href="https://pypi.org/project/yaml-to-sqlite/" rel="nofollow"><img src="https://camo.githubusercontent.com/32afda5e7bc913df42ad343b589f5d20c4fb51d9755037f4af1df86149cd0d94/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f79616d6c2d746f2d73716c6974652e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/yaml-to-sqlite.svg" style="max-width:100%;"></a> <a href="https://github.com/simonw/yaml-to-sqlite/releases"><img src="https://camo.githubusercontent.com/83cd14b53497376686dfabbadad49ff0e485a8a84f8266713a3c89fe7181ccbc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73696d6f6e772f79616d6c2d746f2d73716c6974653f696e636c7564655f70726572656c6561736573266c6162656c3d6368616e67656c6f67" alt="Changelog" data-canonical-src="https://img.shields.io/github/v/release/simonw/yaml-to-sqlite?include_prereleases&label=changelog" style="max-width:100%;"></a> <a href="https://github.com/simonw/yaml-to-sqlite/actions?query=workflow%3ATest"><img src="https://github.com/simonw/yaml-to-sqlite/workflows/Test/badge.svg" alt="Tests" style="max-width:100%;"></a> <a href="https://github.com/simonw/yaml-to-sqlite/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>Load the contents of a YAML file into a SQLite database table.</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="$ yaml-to-sqlite --help Usage: yaml-to-sqlite [OPTIONS] DB_PATH TABLE YAML_FILE Convert YAML files to SQLite Options: --version Show the version and exit. --pk TEXT Column to use as a primary key --single-column TEXT If YAML file is a list of values, populate this column --help Show this message and exit. "><pre><code>$ yaml-to-sqlite --help Usage: yaml-to-sqlite [OPTIONS] DB_PATH TABLE YAML_FILE Convert YAML files to SQLite Options: --version Show the version and exit. --pk TEXT Column to use as a primary key --single-column TEXT If YAML file is a list of values, populate this column --help Show this message and exit. </code></pre></div> <h2><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>Given a <code>news.yml</code> file containing the following:</p> <div class="highlight highlight-source-yaml position-relative" data-snippet-clipboard-copy-content="- date: 2021-06-05 body: |- [Datasette 0.57](https://docs.datasette.io/en/stable/changelog.html#v0-57) is out with an important security patch. - date: 2021-05-10 body: |- [Django SQL Dashboard](https://simonwillison.net/2021/May/10/django-sql-dashboard/) is a new tool that brings a useful authenticated subset of Datasette to Django projects that are built on top of PostgreSQL. "><pre>- <span class="pl-ent">date</span>: <span class="pl-c1">2021-06-05</span> <span class="pl-ent">body</span>: <span class="pl-s">|-</span> <span class="pl-s"> [Datasette 0.57](https://docs.datasette.io/en/stable/changelog.html#v0-57) is out with an important security patch.</span> <span class="pl-s"></span>- <span class="pl-ent">date</span>: <span class="pl-c1">2021-05-10</span> <span class="pl-ent">body</span>: <span class="pl-s">|-</span> <span class="pl-s"> [Django SQL Dashboard](https://simonwillison.net/2021/May/10/django-sql-dashboard/) is a new tool that brings a useful authenticated subset of Datasette to Django projects that are built on top of PostgreSQL.</span></pre></div> <p>Running this command:</p> <div class="highlight highlight-source-shell position-relative" data-snippet-clipboard-copy-content="$ yaml-to-sqlite news.db stories news.yml "><pre>$ yaml-to-sqlite news.db stories news.yml</pre></div> <p>Will create a database file with this schema:</p> <div class="highlight highlight-source-shell position-relative" data-snippet-clipboard-copy-content="$ sqlite-utils schema news.db CREATE TABLE [stories] ( [date] TEXT, [body] TEXT ); "><pre>$ sqlite-utils schema news.db CREATE TABLE [stories] ( [date] TEXT, [body] TEXT )<span class="pl-k">;</span></pre></div> <p>The <code>--pk</code> option can be used to set a column as the primary key for the table:</p> <div class="highlight highlight-source-shell position-relative" data-snippet-clipboard-copy-content="$ yaml-to-sqlite news.db stories news.yml --pk date $ sqlite-utils schema news.db CREATE TABLE [stories] ( [date] TEXT PRIMARY KEY, [body] TEXT ); "><pre>$ yaml-to-sqlite news.db stories news.yml --pk date $ sqlite-utils schema news.db CREATE TABLE [stories] ( [date] TEXT PRIMARY KEY, [body] TEXT )<span class="pl-k">;</span></pre></div> <h2><a id="user-content-single-column-yaml-lists" class="anchor" aria-hidden="true" href="#user-content-single-column-yaml-lists"><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>Single column YAML lists</h2> <p>The <code>--single-column</code> option can be used when the YAML file is a list of values, for example a file called <code>dogs.yml</code> containing the following:</p> <div class="highlight highlight-source-yaml position-relative" data-snippet-clipboard-copy-content="- Cleo - Pancakes - Nixie "><pre>- <span class="pl-s">Cleo</span> - <span class="pl-s">Pancakes</span> - <span class="pl-s">Nixie</span></pre></div> <p>Running this command:</p> <div class="highlight highlight-source-shell position-relative" data-snippet-clipboard-copy-content="$ yaml-to-sqlite dogs.db dogs.yaml --single-column=name "><pre>$ yaml-to-sqlite dogs.db dogs.yaml --single-column=name</pre></div> <p>Will create a single <code>dogs</code> table with a single <code>name</code> column that is the primary key:</p> <div class="highlight highlight-source-shell position-relative" data-snippet-clipboard-copy-content="$ sqlite-utils schema dogs.db CREATE TABLE [dogs] ( [name] TEXT PRIMARY KEY ); $ sqlite-utils dogs.db 'select * from dogs' -t name -------- Cleo Pancakes Nixie "><pre>$ sqlite-utils schema dogs.db CREATE TABLE [dogs] ( [name] TEXT PRIMARY KEY )<span class="pl-k">;</span> $ sqlite-utils dogs.db <span class="pl-s"><span class="pl-pds">'</span>select * from dogs<span class="pl-pds">'</span></span> -t name -------- Cleo Pancakes Nixie</pre></div> </article></div> |
Links from other tables
- 5 rows from repo in releases