Name | datasette-extract JSON |
Version |
0.1a8
JSON |
| download |
home_page | None |
Summary | Import unstructured data (text and images) into structured tables |
upload_time | 2024-07-26 05:02:55 |
maintainer | None |
docs_url | None |
author | Simon Willison |
requires_python | >=3.8 |
license | Apache-2.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# datasette-extract
[![PyPI](https://img.shields.io/pypi/v/datasette-extract.svg)](https://pypi.org/project/datasette-extract/)
[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-extract?include_prereleases&label=changelog)](https://github.com/datasette/datasette-extract/releases)
[![Tests](https://github.com/datasette/datasette-extract/workflows/Test/badge.svg)](https://github.com/datasette/datasette-extract/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-extract/blob/main/LICENSE)
Import unstructured data (text and images) into structured tables
## Installation
Install this plugin in the same environment as [Datasette](https://datasette.io/).
```bash
datasette install datasette-extract
```
## Configuration
This plugin requires an [OpenAI API key](https://platform.openai.com/api-keys).
You can set this using the `DATASETTE_SECRETS_OPENAI_API_KEY` environment variable, or you can configure the [datasette-secrets](https://github.com/datasette/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:
```bash
cd datasette-extract
python3 -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```bash
pip install -e '.[test]'
```
To run the tests:
```bash
pytest
```
Raw data
{
"_id": null,
"home_page": null,
"name": "datasette-extract",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Simon Willison",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/7d/4d/095eb2869fbb0805f6f946c7e8a08098fecf247139b9e9a267b2be63a7c0/datasette_extract-0.1a8.tar.gz",
"platform": null,
"description": "# datasette-extract\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-extract.svg)](https://pypi.org/project/datasette-extract/)\n[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-extract?include_prereleases&label=changelog)](https://github.com/datasette/datasette-extract/releases)\n[![Tests](https://github.com/datasette/datasette-extract/workflows/Test/badge.svg)](https://github.com/datasette/datasette-extract/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-extract/blob/main/LICENSE)\n\nImport unstructured data (text and images) into structured tables\n\n## Installation\n\nInstall this plugin in the same environment as [Datasette](https://datasette.io/).\n```bash\ndatasette install datasette-extract\n```\n\n## Configuration\n\nThis plugin requires an [OpenAI API key](https://platform.openai.com/api-keys).\n\nYou can set this using the `DATASETTE_SECRETS_OPENAI_API_KEY` environment variable, or you can configure the [datasette-secrets](https://github.com/datasette/datasette-secrets) plugin to allow users to enter their own plugin and save it, encrypted, in their database.\n\n## Usage\n\nThis plugin provides the following features:\n\n- 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\n- In the table action cog menu select \"Extract data into this table\" to extract data into an existing table\n\nWhen 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.\n\nWhen populating an existing table you can provide hints and select which columns should be populated.\n\nText input can be pasted directly into the textarea.\n\nDrag 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.\n\nDrag and drop a single image onto the textarea - or select it with the image file input box - to process an image.\n\n## Permissions\n\nUsers must have the `datasette-extract` permission to use this tool.\n\nIn order to create tables they also need the `create-table` permission.\n\nTo insert rows into an existing table they need `insert-row`.\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd datasette-extract\npython3 -m venv venv\nsource venv/bin/activate\n```\nNow install the dependencies and test dependencies:\n```bash\npip install -e '.[test]'\n```\nTo run the tests:\n```bash\npytest\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Import unstructured data (text and images) into structured tables",
"version": "0.1a8",
"project_urls": {
"CI": "https://github.com/datasette/datasette-extract/actions",
"Changelog": "https://github.com/datasette/datasette-extract/releases",
"Homepage": "https://github.com/datasette/datasette-extract",
"Issues": "https://github.com/datasette/datasette-extract/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9f4956176bd577001147c8daac8f7062d765a8e63636f382ff3442845cf254d2",
"md5": "9b8e71cddfb605c69d00412e720739e8",
"sha256": "e770c6f20f1554149cc039c2ef4611900eccdf47bc598700082bdd5c0520bb44"
},
"downloads": -1,
"filename": "datasette_extract-0.1a8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9b8e71cddfb605c69d00412e720739e8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 816620,
"upload_time": "2024-07-26T05:02:53",
"upload_time_iso_8601": "2024-07-26T05:02:53.905252Z",
"url": "https://files.pythonhosted.org/packages/9f/49/56176bd577001147c8daac8f7062d765a8e63636f382ff3442845cf254d2/datasette_extract-0.1a8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7d4d095eb2869fbb0805f6f946c7e8a08098fecf247139b9e9a267b2be63a7c0",
"md5": "3a58936be50ecc55be1256bb08ddea99",
"sha256": "760c49fa29909f42c9e8311f87de613f0f690d05fd7f7bd2ec1e3fa10c271232"
},
"downloads": -1,
"filename": "datasette_extract-0.1a8.tar.gz",
"has_sig": false,
"md5_digest": "3a58936be50ecc55be1256bb08ddea99",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 807628,
"upload_time": "2024-07-26T05:02:55",
"upload_time_iso_8601": "2024-07-26T05:02:55.641166Z",
"url": "https://files.pythonhosted.org/packages/7d/4d/095eb2869fbb0805f6f946c7e8a08098fecf247139b9e9a267b2be63a7c0/datasette_extract-0.1a8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-26 05:02:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "datasette",
"github_project": "datasette-extract",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "datasette-extract"
}