Download tables as xlsx-file
Project description
datasette-render-xlsx
Download Datasette table as xlsx-file using XlsxWriter
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-render-xlsx
Usage
This plugin adds a link for downloading the current table as an xslx-file that can be opened and edited in e.g. MS Excel or LibreOffice.
The amount of rows rendered is limited by the value max_returned_rows in Datasette's settings, which defaults to 1000 rows. It is possible to set a lower limit by using the plugin settings in Metadata:
{
"databases": {
"sf-trees": {
"plugins": {
"datasette-render-xsls": {
"max_rows": "500"
}
}
}
}
}`
Tables containing columns with blobs can't yet be rendered. Labels that are used to display value from another table (foreign keys) can't be rendered. The actual value will be shown.
You can turn off xlsx-rendering from specific databases or tables in the Metadata settings:
{
"databases": {
"sakila": {
"tables": {
"category": {
"plugins": {
"datasette-render-xlsx": {
"do_not_render": true
}
}
}
}
}
}
}
In this case there will be no link for download.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-render-xlsx
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for datasette-render-xlsx-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14690cd7c06c22e8251bd8682353b73fa5f4a15458eaacac624d33c09209ff21 |
|
MD5 | db2ffa30a5b685a4f49d218d2c69a5bc |
|
BLAKE2b-256 | eb1973ffc99e12323c0b2337b151c224b90c63b049f39cade64c9b58cc0e5b04 |