https://github.com/simonw/datasette-copyable
Datasette plugin for outputting tables in formats suitable for copy and paste
https://github.com/simonw/datasette-copyable
datasette datasette-io datasette-plugin
Last synced: 3 months ago
JSON representation
Datasette plugin for outputting tables in formats suitable for copy and paste
- Host: GitHub
- URL: https://github.com/simonw/datasette-copyable
- Owner: simonw
- Created: 2020-07-21T19:04:08.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-02-17T23:11:29.000Z (over 1 year ago)
- Last Synced: 2024-10-18T07:53:33.090Z (9 months ago)
- Topics: datasette, datasette-io, datasette-plugin
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# datasette-copyable
[](https://pypi.org/project/datasette-copyable/)
[](https://github.com/simonw/datasette-copyable/releases)
[](https://github.com/simonw/datasette-copyable/blob/master/LICENSE)Datasette plugin for outputting tables in formats suitable for copy and paste
## Installation
Install this plugin in the same environment as Datasette.
$ pip install datasette-copyable
## Demo
You can try this plugin on [fivethirtyeight.datasettes.com](https://fivethirtyeight.datasettes.com/) - browse for tables or queries there and look for the "copyable" link. Here's an example for a table of [airline safety data](https://fivethirtyeight.datasettes.com/fivethirtyeight/airline-safety~2Fairline-safety.copyable).
## Usage
This plugin adds a `.copyable` output extension to every table, view and query.
Navigating to this page will show an interface allowing you to select a format for copying and pasting the demo. The default is TSV, which is suitable for copying into Google Sheets or Excel.
You can add `?_raw=1` to get back just the raw data.
## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-copyable
python3 -mvenv venv
source venv/bin/activateOr if you are using `pipenv`:
pipenv shell
Now install the dependencies and tests:
pip install -e '.[test]'
To run the tests:
pytest