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 details)

Uploaded Source

File details

Details for the file datasette-render-xlsx-0.1.tar.gz.

File metadata

  • Download URL: datasette-render-xlsx-0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for datasette-render-xlsx-0.1.tar.gz
Algorithm Hash digest
SHA256 14690cd7c06c22e8251bd8682353b73fa5f4a15458eaacac624d33c09209ff21
MD5 db2ffa30a5b685a4f49d218d2c69a5bc
BLAKE2b-256 eb1973ffc99e12323c0b2337b151c224b90c63b049f39cade64c9b58cc0e5b04

See more details on using hashes here.

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