Skip to main content

Pin databases, tables, and other items to the Datasette homepage

Project description

datasette-pins

PyPI Changelog Tests License

Pin databases, tables, queries, and more to the Datasette homepage!

Installation

datasette-pins requires a recent 1.0 alpha version of Datasette to work.

pip install datasette>=1.0a13

Afterwards, install this plugin in the same environment as Datasette.

datasette install datasette-pins

Configuration

datasette-pins stores pins in the internal database. This database runs in-memory by default, which means your pins will be lost if you restart the server. To avoid that, start Datasette with the --internal option to specify where that database should be stored on disk:

datasette mydatabase.db --internal internal.db

datasette-pins has two permissions datasette-pins-write and datasette-pins-read. Actors with the datasette-pins-write permissions can pin and reorder items, while actors with datasette-pins-read permissions can only view pinned items.

Here's an example datasette.yaml file where all actors can view pins, but only the root actor can pin items:

permissions:
  datasette-pins-read:
    id: "*"
    unauthenticated: true
  datasette-pins-write:
    id: "root"

Usage

Once logged in, the root use will see new pin/unpin option under the database, table, and query actions menu:

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-pins
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Building JavaScript from TypeScript

This plugin includes TypeScript/TSX source files in datasette_pins/frontend/ that need to be compiled to JavaScript. If you modify any .ts or .tsx files, you'll need to rebuild the JavaScript.

First install the Node.js dependencies:

npm install

Then build the JavaScript using just:

just js

This uses esbuild to compile and minify the TypeScript files into datasette_pins/static/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette_pins-0.1a6.tar.gz (33.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datasette_pins-0.1a6-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file datasette_pins-0.1a6.tar.gz.

File metadata

  • Download URL: datasette_pins-0.1a6.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for datasette_pins-0.1a6.tar.gz
Algorithm Hash digest
SHA256 ac58bfbe2b02c9df7dd743970c943a0235a4824b8fd3403f8ecb0b4f68311cc6
MD5 3fcb47577477f5bdef8b05e865dac161
BLAKE2b-256 cb00e4595b930f911f1e4aeaeac98eb116fa345810bb882969ad96f745a6e53f

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_pins-0.1a6.tar.gz:

Publisher: publish.yml on datasette/datasette-pins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datasette_pins-0.1a6-py3-none-any.whl.

File metadata

  • Download URL: datasette_pins-0.1a6-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for datasette_pins-0.1a6-py3-none-any.whl
Algorithm Hash digest
SHA256 c2c7c73b2371392f5f555142a9b57e80371534667acfc2330022b116201a18cf
MD5 7c7b24065f65f93626693e16c2922f45
BLAKE2b-256 30215ba323b1d6823f27bcabb2877eaa7a2bddaa43b1b5bf1d82f1b0136a294a

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_pins-0.1a6-py3-none-any.whl:

Publisher: publish.yml on datasette/datasette-pins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page