Skip to main content

sqlite-utils-ask

PyPI Changelog Tests License

Ask questions of your data with LLM assistance

Installation

Install this plugin in the same environment as sqlite-utils.

sqlite-utils install sqlite-utils-ask

sqlite-utils ask

Ask questions of a SQLite database file like this:

sqlite-utils ask content.db 'How many repos?'

The tool will use an LLM (gpt-4o-mini by default) to generate the appropriate SQL query by passing through your question and the database schema, and will then execute the query and return the result.

sqlite-utils ask-files

You can also ask questions directly of CSV, TSV or JSON files. These will be imported into an in-memory SQLite database prior to running the query.

sqlite-utils ask-files data.csv 'How many repos?'

You can pass multiple files and run queries across multiple resulting tables.

sqlite-utils ask-files legislators.csv votes.csv 'How many votes did each legislator cast?'

Development

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

cd sqlite-utils-ask
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

python -m pytest

To capture new HTTP interactions, run:

PYTEST_OPENAI_API_KEY=your-key python -m pytest --record-mode once

Or use --record-mode all to re-record all interactions.

Release files for sqlite-utils-ask 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlite-utils-ask 0.2
File Size Uploaded
sqlite_utils_ask-0.2.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlite-utils-ask 0.2
File Interpreter ABI Platform
sqlite_utils_ask-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / sqlite_utils_ask-0.2.tar.gz

Download URL sqlite_utils_ask-0.2.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6c53244899558fe4c777ddf53f1cf5ade1a6c641fea318f71110d97a3903686a
BLAKE2b-256 checksum
How to use checksums
33b1169a2f91c8a95dc35173c1851511449282ecc8a786feb8d6d7a977eb2f88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2024.

Transparency log

Release files / sqlite_utils_ask-0.2-py3-none-any.whl

Download URL sqlite_utils_ask-0.2-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab9fb445987e230a66361c5bbf99d9ecf8670bf3c08367f445875862f0faa01e
BLAKE2b-256 checksum
How to use checksums
5f23370b67bdfb820ecdf513f7f4861f25a551df0addcee815c5281806d2630b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page