datasette-homepage-table by datasette

39 downloads this week        Star

README source code

datasette-homepage-table

PyPI Changelog Tests License

Show a specific Datasette table on the homepage

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-homepage-table

Usage

This plugin changes the Datasette homepage to display a table instead of the default list of databases.

Without configuration, it will take the first table in the first attached database.

Alternatively you can configure it like this:

{
    "plugins": {
        "datasette-homepage-table": {
            "database": "mydatabase",
            "table": "mytable"
        }
    }
}

Both keys are optional: if you omit database it will use the first attached database, and if you omit table it will use the first table in the database.

You can customize the table.html template to change the appearance of the table.

Development

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

cd datasette-homepage-table
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest