datasette-pins


Namedatasette-pins JSON
Version 0.1a4 PyPI version JSON
download
home_pageNone
SummaryPin databases, tables, and other items to the Datasette homepage
upload_time2024-09-01 22:16:55
maintainerNone
docs_urlNone
authorAlex Garcia
requires_python>=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # datasette-pins

[![PyPI](https://img.shields.io/pypi/v/datasette-pins.svg)](https://pypi.org/project/datasette-pins/)
[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-pins?include_prereleases&label=changelog)](https://github.com/datasette/datasette-pins/releases)
[![Tests](https://github.com/datasette/datasette-pins/actions/workflows/test.yml/badge.svg)](https://github.com/datasette/datasette-pins/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-pins/blob/main/LICENSE)

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

<img src="https://datasette-cloud-assets.s3.amazonaws.com/blog/2024/datasette-pins/hero.png"/>

## Installation

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

```bash
pip install datasette>=1.0a13
```
Afterwards, install this plugin in the same environment as Datasette.

```bash
datasette install datasette-pins
```

## Configuration

`datasette-pins` stores pins in the [internal database](https://docs.datasette.io/en/latest/internals.html#datasette-s-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:

```bash
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](https://docs.datasette.io/en/latest/configuration.html#datasette-yaml-reference)
where all actors can view pins, but only the `root` actor can pin items:

```yaml
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:

<img src="https://datasette-cloud-assets.s3.amazonaws.com/blog/2024/datasette-pins/table-example.png"/>

## Development

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

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

Now install the dependencies and test dependencies:

```bash
pip install -e '.[test]'
```

To run the tests:

```bash
pytest
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "datasette-pins",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Alex Garcia",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/34/ff/07d0ee2c17e4870caec6ecfd68ac240adf8b6509c3c1a9fbea04df8af940/datasette_pins-0.1a4.tar.gz",
    "platform": null,
    "description": "# datasette-pins\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-pins.svg)](https://pypi.org/project/datasette-pins/)\n[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-pins?include_prereleases&label=changelog)](https://github.com/datasette/datasette-pins/releases)\n[![Tests](https://github.com/datasette/datasette-pins/actions/workflows/test.yml/badge.svg)](https://github.com/datasette/datasette-pins/actions/workflows/test.yml)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-pins/blob/main/LICENSE)\n\nPin databases, tables, queries, and more to the Datasette homepage!\n\n<img src=\"https://datasette-cloud-assets.s3.amazonaws.com/blog/2024/datasette-pins/hero.png\"/>\n\n## Installation\n\n`datasette-pins` requires a recent 1.0 alpha version of Datasette to work.\n\n```bash\npip install datasette>=1.0a13\n```\nAfterwards, install this plugin in the same environment as Datasette.\n\n```bash\ndatasette install datasette-pins\n```\n\n## Configuration\n\n`datasette-pins` stores pins in the [internal database](https://docs.datasette.io/en/latest/internals.html#datasette-s-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:\n\n```bash\ndatasette mydatabase.db --internal internal.db\n```\n`datasette-pins` has two permissions `datasette-pins-write` and\n`datasette-pins-read`. Actors with the `datasette-pins-write` permissions can\npin and reorder items, while actors with `datasette-pins-read` permissions can\nonly view pinned items.\n\nHere's an example\n[`datasette.yaml` file](https://docs.datasette.io/en/latest/configuration.html#datasette-yaml-reference)\nwhere all actors can view pins, but only the `root` actor can pin items:\n\n```yaml\npermissions:\n  datasette-pins-read:\n    id: \"*\"\n    unauthenticated: true\n  datasette-pins-write:\n    id: \"root\"\n```\n\n## Usage\n\nOnce logged in, the `root` use will see new pin/unpin option under the database,\ntable, and query actions menu:\n\n<img src=\"https://datasette-cloud-assets.s3.amazonaws.com/blog/2024/datasette-pins/table-example.png\"/>\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new\nvirtual environment:\n\n```bash\ncd datasette-pins\npython3 -m venv venv\nsource venv/bin/activate\n```\n\nNow install the dependencies and test dependencies:\n\n```bash\npip install -e '.[test]'\n```\n\nTo run the tests:\n\n```bash\npytest\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Pin databases, tables, and other items to the Datasette homepage",
    "version": "0.1a4",
    "project_urls": {
        "CI": "https://github.com/datasette/datasette-pins/actions",
        "Changelog": "https://github.com/datasette/datasette-pins/releases",
        "Homepage": "https://github.com/datasette/datasette-pins",
        "Issues": "https://github.com/datasette/datasette-pins/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59ffcafdda87f0f821ebb21852855665c7da26d2b5b76df889ed2381517e4d98",
                "md5": "653e77dbeaa932951f45140929207f44",
                "sha256": "035ffa9cd18cfa4cc246fc960f50ae86ea093c33803dfecd49ff4078c3df3e90"
            },
            "downloads": -1,
            "filename": "datasette_pins-0.1a4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "653e77dbeaa932951f45140929207f44",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 41452,
            "upload_time": "2024-09-01T22:16:53",
            "upload_time_iso_8601": "2024-09-01T22:16:53.756269Z",
            "url": "https://files.pythonhosted.org/packages/59/ff/cafdda87f0f821ebb21852855665c7da26d2b5b76df889ed2381517e4d98/datasette_pins-0.1a4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "34ff07d0ee2c17e4870caec6ecfd68ac240adf8b6509c3c1a9fbea04df8af940",
                "md5": "8ecec072519f86ef96258d7ea97a9eae",
                "sha256": "09c80170c10b0d0990fcd58cfb0fc9e5fcdea74d18f1ea00695afec5b03ee0b7"
            },
            "downloads": -1,
            "filename": "datasette_pins-0.1a4.tar.gz",
            "has_sig": false,
            "md5_digest": "8ecec072519f86ef96258d7ea97a9eae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 38068,
            "upload_time": "2024-09-01T22:16:55",
            "upload_time_iso_8601": "2024-09-01T22:16:55.241833Z",
            "url": "https://files.pythonhosted.org/packages/34/ff/07d0ee2c17e4870caec6ecfd68ac240adf8b6509c3c1a9fbea04df8af940/datasette_pins-0.1a4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-01 22:16:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "datasette",
    "github_project": "datasette-pins",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "datasette-pins"
}
        
Elapsed time: 0.89342s