datasette-extract


Namedatasette-extract JSON
Version 0.1a7 PyPI version JSON
download
home_pageNone
SummaryImport unstructured data (text and images) into structured tables
upload_time2024-05-15 04:32:23
maintainerNone
docs_urlNone
authorSimon Willison
requires_python>=3.8
licenseApache-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/8f/9b/ef48778b6e6edbb4a8b03d40032623b61f38621aaf6c08c285a23c0b5fb7/datasette_extract-0.1a7.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.1a7",
    "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": "f75852c360fdc7028650bef4fb72b8f6d542b6b1e8b9dca8386eb73db98e9e8f",
                "md5": "291c43fc85f897da602acd8065b8847a",
                "sha256": "a27f6d55712b3740b2c3ab117a5fa861248ec3a34d611d16dc89d255dcaa76a9"
            },
            "downloads": -1,
            "filename": "datasette_extract-0.1a7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "291c43fc85f897da602acd8065b8847a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 815658,
            "upload_time": "2024-05-15T04:32:21",
            "upload_time_iso_8601": "2024-05-15T04:32:21.666607Z",
            "url": "https://files.pythonhosted.org/packages/f7/58/52c360fdc7028650bef4fb72b8f6d542b6b1e8b9dca8386eb73db98e9e8f/datasette_extract-0.1a7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f9bef48778b6e6edbb4a8b03d40032623b61f38621aaf6c08c285a23c0b5fb7",
                "md5": "85518a310b36de8a23d20b93a4742add",
                "sha256": "4e3c02069ece412c08687783e99383ff68911d85114ce0f461bd0d8d145ceb0e"
            },
            "downloads": -1,
            "filename": "datasette_extract-0.1a7.tar.gz",
            "has_sig": false,
            "md5_digest": "85518a310b36de8a23d20b93a4742add",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 806723,
            "upload_time": "2024-05-15T04:32:23",
            "upload_time_iso_8601": "2024-05-15T04:32:23.575579Z",
            "url": "https://files.pythonhosted.org/packages/8f/9b/ef48778b6e6edbb4a8b03d40032623b61f38621aaf6c08c285a23c0b5fb7/datasette_extract-0.1a7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-15 04:32:23",
    "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"
}
        
Elapsed time: 0.25817s