repos: 461322238
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
461322238 | R_kgDOG383_g | sqlite-colorbrewer | eyeseast/sqlite-colorbrewer | 0 | 25778 | https://github.com/eyeseast/sqlite-colorbrewer | A custom function to use ColorBrewer scales in SQLite queries | 0 | 2022-02-19T21:53:46Z | 2022-03-03T17:16:40Z | 2022-03-02T03:04:56Z | 19 | 4 | 4 | Python | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | apache-2.0 | [] | 0 | 0 | 4 | main | {"admin": false, "maintain": false, "push": false, "triage": false, "pull": false} | 0 | 1 | # sqlite-colorbrewer [](https://pypi.org/project/sqlite-colorbrewer/) [](https://github.com/eyeseast/sqlite-colorbrewer/releases) [](https://github.com/eyeseast/sqlite-colorbrewer/actions?query=workflow%3ATest) [](https://github.com/eyeseast/sqlite-colorbrewer/blob/main/LICENSE) A custom function to use [ColorBrewer](https://colorbrewer2.org/) scales in SQLite queries. Colors are exported from [here](https://colorbrewer2.org/export/colorbrewer.json). ## Installation To install as a Python library and use with the [standard SQLite3 module](https://docs.python.org/3/library/sqlite3.html): pip install sqlite-colorbrewer To install this plugin in the same environment as Datasette. datasette install sqlite-colorbrewer ## Usage If you're using this library with Datasette, it will be automatically registered as a plugin and available for use in SQL queries, like so: ```sql SELECT colorbrewer('Blues', 9, 0); ``` That will return a single value: `"rgb(247,251,255)"` To use with a SQLite connection outside of Datasette, use the `register` function: ```python >>> import sqlite3 >>> import sqlite_colorbrewer >>> conn = sqlite3.connect(':memory') >>> sqlite_colorbrewer.register(conn) >>> cursor = conn.execute("SELECT colorbrewer('Blues', 9, 0);") >>> result = next(cursor) >>> print(result) rgb(247,251,255) ``` ## Development To set up this plugin locally, first checkout the code. Then create a new virtual environment: cd sqlite-colorbrewer 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 To build `sqlite_colorbrewer/colorbrewer.py`: ./json_to_python.py black . # to format the resulting file ## ColorBrewer Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See the [ColorBrewer updates](http://www.personal.psu.edu/cab38/ColorBrewer/ColorBrewer_updates.html) for updates to copyright information. | <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-sqlite-colorbrewer" class="anchor" aria-hidden="true" href="#user-content-sqlite-colorbrewer"><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>sqlite-colorbrewer</h1> <p dir="auto"><a href="https://pypi.org/project/sqlite-colorbrewer/" rel="nofollow"><img src="https://camo.githubusercontent.com/04ce9615649f436d9d448e3c317bf8f12473237aa608429218b746755cbd0ef6/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f73716c6974652d636f6c6f726272657765722e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/sqlite-colorbrewer.svg" style="max-width: 100%;"></a> <a href="https://github.com/eyeseast/sqlite-colorbrewer/releases"><img src="https://camo.githubusercontent.com/638c41b57fe97aeaec1e6be4a0f1d0c69e4d9259585553a48a5f21ef40047542/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f65796573656173742f73716c6974652d636f6c6f726272657765723f696e636c7564655f70726572656c6561736573266c6162656c3d6368616e67656c6f67" alt="Changelog" data-canonical-src="https://img.shields.io/github/v/release/eyeseast/sqlite-colorbrewer?include_prereleases&label=changelog" style="max-width: 100%;"></a> <a href="https://github.com/eyeseast/sqlite-colorbrewer/actions?query=workflow%3ATest"><img src="https://github.com/eyeseast/sqlite-colorbrewer/workflows/Test/badge.svg" alt="Tests" style="max-width: 100%;"></a> <a href="https://github.com/eyeseast/sqlite-colorbrewer/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">A custom function to use <a href="https://colorbrewer2.org/" rel="nofollow">ColorBrewer</a> scales in SQLite queries.</p> <p dir="auto">Colors are exported from <a href="https://colorbrewer2.org/export/colorbrewer.json" rel="nofollow">here</a>.</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">To install as a Python library and use with the <a href="https://docs.python.org/3/library/sqlite3.html" rel="nofollow">standard SQLite3 module</a>:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="pip install sqlite-colorbrewer"><pre><code>pip install sqlite-colorbrewer </code></pre></div> <p dir="auto">To 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 sqlite-colorbrewer"><pre><code>datasette install sqlite-colorbrewer </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">If you're using this library with Datasette, it will be automatically registered as a plugin and available for use in SQL queries, like so:</p> <div class="highlight highlight-source-sql position-relative overflow-auto" data-snippet-clipboard-copy-content="SELECT colorbrewer('Blues', 9, 0);"><pre><span class="pl-k">SELECT</span> colorbrewer(<span class="pl-s"><span class="pl-pds">'</span>Blues<span class="pl-pds">'</span></span>, <span class="pl-c1">9</span>, <span class="pl-c1">0</span>);</pre></div> <p dir="auto">That will return a single value: <code>"rgb(247,251,255)"</code></p> <p dir="auto">To use with a SQLite connection outside of Datasette, use the <code>register</code> function:</p> <div class="highlight highlight-source-python position-relative overflow-auto" data-snippet-clipboard-copy-content=">>> import sqlite3 >>> import sqlite_colorbrewer >>> conn = sqlite3.connect(':memory') >>> sqlite_colorbrewer.register(conn) >>> cursor = conn.execute("SELECT colorbrewer('Blues', 9, 0);") >>> result = next(cursor) >>> print(result) rgb(247,251,255)"><pre><span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-k">import</span> <span class="pl-s1">sqlite3</span> <span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-k">import</span> <span class="pl-s1">sqlite_colorbrewer</span> <span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-s1">conn</span> <span class="pl-c1">=</span> <span class="pl-s1">sqlite3</span>.<span class="pl-en">connect</span>(<span class="pl-s">':memory'</span>) <span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-s1">sqlite_colorbrewer</span>.<span class="pl-en">register</span>(<span class="pl-s1">conn</span>) <span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-s1">cursor</span> <span class="pl-c1">=</span> <span class="pl-s1">conn</span>.<span class="pl-en">execute</span>(<span class="pl-s">"SELECT colorbrewer('Blues', 9, 0);"</span>) <span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-en">next</span>(<span class="pl-s1">cursor</span>) <span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-en">print</span>(<span class="pl-s1">result</span>) <span class="pl-en">rgb</span>(<span class="pl-c1">247</span>,<span class="pl-c1">251</span>,<span class="pl-c1">255</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 sqlite-colorbrewer python3 -mvenv venv source venv/bin/activate"><pre><code>cd sqlite-colorbrewer 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> <p dir="auto">To build <code>sqlite_colorbrewer/colorbrewer.py</code>:</p> <div class="snippet-clipboard-content position-relative overflow-auto" data-snippet-clipboard-copy-content="./json_to_python.py black . # to format the resulting file"><pre><code>./json_to_python.py black . # to format the resulting file </code></pre></div> <h2 dir="auto"><a id="user-content-colorbrewer" class="anchor" aria-hidden="true" href="#user-content-colorbrewer"><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>ColorBrewer</h2> <p dir="auto">Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University.</p> <p dir="auto">Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at</p> <p dir="auto"><a href="http://www.apache.org/licenses/LICENSE-2.0" rel="nofollow">http://www.apache.org/licenses/LICENSE-2.0</a></p> <p dir="auto">Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p> <p dir="auto">See the <a href="http://www.personal.psu.edu/cab38/ColorBrewer/ColorBrewer_updates.html" rel="nofollow">ColorBrewer updates</a> for updates to copyright information.</p> </article></div> | 1 | public | 0 |
Links from other tables
- 1 row from repo in releases