Import unstructured data (text and images) into structured tables
Project description
datasette-extract
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.
You can set this using the DATASETTE_SECRETS_OPENAI_API_KEY
environment variable, or you can configure the datasette-secrets plugin to allow users to enter their own plugin and save it, encrypted, in their database.
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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file datasette_extract-0.1a8.tar.gz
.
File metadata
- Download URL: datasette_extract-0.1a8.tar.gz
- Upload date:
- Size: 807.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 760c49fa29909f42c9e8311f87de613f0f690d05fd7f7bd2ec1e3fa10c271232 |
|
MD5 | 3a58936be50ecc55be1256bb08ddea99 |
|
BLAKE2b-256 | 7d4d095eb2869fbb0805f6f946c7e8a08098fecf247139b9e9a267b2be63a7c0 |
File details
Details for the file datasette_extract-0.1a8-py3-none-any.whl
.
File metadata
- Download URL: datasette_extract-0.1a8-py3-none-any.whl
- Upload date:
- Size: 816.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e770c6f20f1554149cc039c2ef4611900eccdf47bc598700082bdd5c0520bb44 |
|
MD5 | 9b8e71cddfb605c69d00412e720739e8 |
|
BLAKE2b-256 | 9f4956176bd577001147c8daac8f7062d765a8e63636f382ff3442845cf254d2 |