Skip to main content

Import unstructured data (text and images) into structured tables

Project description

datasette-extract

PyPI Changelog Tests License

Import unstructured data (text and images) into structured tables

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-extract

Configuration

This plugin requires an OPENAI_API_KEY environment variable with an OpenAI API key.

Usage

This plugin provides the following features:

  • In the database action cog menu for a database select "Create table with extracted data" to create a new table with data extracted from text or an image
  • In the table action cog menu select "Extract data into this table" to extract data into an existing table

When creating a table you can specify the column names, types and provide an optional hint (like "YYYY-MM-DD" for dates) to influence how the data should be extracted.

When populating an existing table you can provide hints and select which columns should be populated.

Text input can be pasted directly into the textarea.

Drag and drop a PDF or text file onto the textarea to populate it with the contents of that file. PDF files will have their text extracted, but only if the file contains text as opposed to scanned images.

Drag and drop a single image onto the textarea - or select it with the image file input box - to process an image. These will have OCR run against them using GPT-4 Vision and then that text will be used for structured data extraction.

Permissions

Users must have the datasette-extract permission to use this tool.

In order to create tables they also need the create-table permission.

To insert rows into an existing table they need insert-row.

Development

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

cd datasette-extract
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

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-extract-0.1a4.tar.gz (806.2 kB view details)

Uploaded Source

Built Distribution

datasette_extract-0.1a4-py3-none-any.whl (815.0 kB view details)

Uploaded Python 3

File details

Details for the file datasette-extract-0.1a4.tar.gz.

File metadata

  • Download URL: datasette-extract-0.1a4.tar.gz
  • Upload date:
  • Size: 806.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for datasette-extract-0.1a4.tar.gz
Algorithm Hash digest
SHA256 341f07f525ba31a643e6483f7fb35d9fe24a21f3bc23987d8406afaf74b29276
MD5 6ba9c32f09183dfb1da6df4a85cf9c3e
BLAKE2b-256 3eee54103aceb3b798639279feaeca40e816ddb6b1496e310955c314f958cf06

See more details on using hashes here.

File details

Details for the file datasette_extract-0.1a4-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_extract-0.1a4-py3-none-any.whl
Algorithm Hash digest
SHA256 318b0dad7b24393ab6189a2fe2b8434a011d9e6874bfd2bbcf0546fbd34ee7e2
MD5 9e84461e4d7eeaa972407db912c3b767
BLAKE2b-256 617832ae67446c72816357284fcc711695274e530e465e4ed699f51a15f99085

See more details on using hashes here.

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