Skip to main content

Download tables as xlsx-file

Project description

datasette-render-xlsx

PyPI Changelog Tests License

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

This version

0.1

Download files

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

Source Distribution

datasette-render-xlsx-0.1.tar.gz (7.8 kB view hashes)

Uploaded Source

Supported by

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