
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
A custom function to use ColorBrewer scales in SQLite queries.
Colors are exported from here.
To install as a Python library and use with the standard SQLite3 module:
pip install sqlite-colorbrewer
To install this plugin in the same environment as Datasette.
datasette install sqlite-colorbrewer
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:
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:
>>> 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)
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
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 for updates to copyright information.
FAQs
A custom function to use ColorBrewer scales in SQLite queries
We found that sqlite-colorbrewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.