Datasette provides an instant, read-only JSON API for any SQLite database. It also provides tools for packaging the database up as a Docker container and deploying that container to hosting providers such as [Zeit Now](https://zeit.co/now).
## Installation
pip3 install datasette
Datasette requires Python 3.5 or higher.
## Basic usage
datasette serve path/to/database.db
This will start a web server on port 8001 - visit http://localhost:8001/ to access the web interface.
`serve` is the default subcommand, you can omit it if you like.
Use Chrome on OS X? You can run datasette against your browser history like so:
If you want to include licensing and source information in the generated datasette website you can do so using a JSON file that looks something like this:
The license and source information will be displayed on the index page and in the footer. They will also be included in the JSON produced by the API.
## datasette publish
If you have [Zeit Now](https://zeit.co/now) installed, datasette can deploy one or more SQLite databases to the internet with a single command:
datasette publish now database.db
This will create a docker image containing both the datasette application and the specified SQLite database files. It will then deploy that image to Zeit Now and give you a URL to access the API.
Publish specified SQLite database files to the internet along with a
datasette API.
Only current option for PUBLISHER is 'now'. You must have Zeit Now
installed: https://zeit.co/now
Example usage: datasette publish now my-database.db
Options:
-n, --name TEXT Application name to use when deploying to Now
-m, --metadata FILENAME Path to JSON file containing metadata to publish
--help Show this message and exit.
## datasette package
If you have docker installed you can use `datasette package` to create a new Docker image in your local repository containing the datasette app and selected SQLite databases:
$ datasette package --help
Usage: datasette package [OPTIONS] FILES...
Package specified SQLite files into a new datasette Docker container
Options:
-t, --tag TEXT Name for the resulting Docker container, can
optionally use name:tag format
-m, --metadata FILENAME Path to JSON file containing metadata to publish