serve and publish commands now take a --metadata option

If provided, the --metadata option is the path to a JSON file containing
metadata that should be displayed alongside the dataset.

    datasette /tmp/fivethirtyeight.db --metadata /tmp/metadata.json

Currently that metadata format looks like this:

    {
        "title": "Five Thirty Eight",
        "license": "CC Attribution 4.0 License",
        "license_url": "http://creativecommons.org/licenses/by/4.0/",
        "source": "fivethirtyeight/data on GitHub",
        "source_url": "https://github.com/fivethirtyeight/data"
    }

If provided, this will be used by the index template and to populate the
common footer.

The publish command also accepts this argument, and will package any provided
metadata up and include it with the resulting Docker container.

    datasette publish --metadata /tmp/metadata.json /tmp/fivethirtyeight.db

Closes #68
This commit is contained in:
Simon Willison 2017-11-13 07:20:02 -08:00
commit 3ef35ca8b4
6 changed files with 113 additions and 62 deletions

View file

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='datasette',
version='0.5',
version='0.6',
packages=find_packages(),
package_data={'datasette': ['templates/*.html']},
include_package_data=True,