Skip to main content

Query databases and tables with AI assistance

Project description

datasette-query-assistant

PyPI Changelog Tests License

Query databases and tables with AI assistance

Early alpha.

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-query-assistant

Configuration

This plugin currently requires you to set the ANTHROPIC_API_KEY environment variable to a working Anthropic API key.

Usage

Users with execute-sql permission will gain a database action menu item for "Query this database with AI assistance" which will let them ask a question and be redirected to SQL that will hopefully answer it.

Development

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

cd datasette-query-assistant
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

To re-generate the tests with refreshed examples from the Claude 3 API:

pytest -x --record-mode=rewrite --inline-snapshot=fix

Project details


Download files

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

Source Distribution

datasette_query_assistant-0.1a2.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

datasette_query_assistant-0.1a2-py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 3

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