Metadata-Version: 2.3
Name: sdeul
Version: 0.1.7
Summary: Structural Data Extractor using LLMs
License: AGPL-3.0-or-later
Keywords: llm
Author: Daichi Narushima
Author-email: dceoy@users.noreply.github.com
Maintainer: Daichi Narushima
Maintainer-email: dceoy@users.noreply.github.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Requires-Dist: boto3-stubs[sts] (>=1.35.24,<2.0.0)
Requires-Dist: jsonschema (>=4.23.0,<5.0.0)
Requires-Dist: langchain (>=0.3.0,<0.4.0)
Requires-Dist: langchain-aws (>=0.2.0,<0.3.0)
Requires-Dist: langchain-community (>=0.3.0,<0.4.0)
Requires-Dist: langchain-google-genai (>=2.1.0,<3.0.0)
Requires-Dist: langchain-groq (>=0.3.0,<0.4.0)
Requires-Dist: langchain-ollama (>=0.3.0,<0.4.0)
Requires-Dist: langchain-openai (>=0.3.0,<0.4.0)
Requires-Dist: llama-cpp-python (>=0.3.0,<0.4.0)
Requires-Dist: typer (>=0.15,<0.17)
Project-URL: Documentation, https://github.com/dceoy/sdeul/blob/main/README.md
Project-URL: Homepage, https://github.com/dceoy/sdeul
Project-URL: Repository, https://github.com/dceoy/sdeul.git
Description-Content-Type: text/markdown

sdeul
=====

Structural Data Extractor using LLMs

[![CI/CD](https://github.com/dceoy/sdeul/actions/workflows/ci.yml/badge.svg)](https://github.com/dceoy/sdeul/actions/workflows/ci.yml)

Installation
------------

```sh
$ pip install -U sdeul
```

Usage
-----

1.  Create a JSON Schema file for the output

2.  Prepare a local model GGUF file or model API key.

3.  Extract structural data from given text using `sdeul extract`.

    Example:

    ```sh
    # Use OpenAI API
    $ sdeul extract --openai-model='gpt-4o-mini' \
        test/data/medication_history.schema.json \
        test/data/patient_medication_record.txt

    # Use Amazon Bedrock API
    $ sdeul extract --bedrock-model='us.anthropic.claude-3-7-sonnet-20250219-v1:0' \
        test/data/medication_history.schema.json \
        test/data/patient_medication_record.txt

    # Use Groq API
    $ sdeul extract --groq-model='llama-3.3-70b-versatile' \
        test/data/medication_history.schema.json \
        test/data/patient_medication_record.txt

    # Use Ollama API
    $ sdeul extract --ollama-model='gemma3:27b' \
        test/data/medication_history.schema.json \
        test/data/patient_medication_record.txt

    # Use a GGUF file
    $ sdeul extract --model-file='google_gemma-3-27b-it-Q4_K_M.gguf' \
        test/data/medication_history.schema.json \
        test/data/patient_medication_record.txt
    ```

    Expected output:

    ```json
    {
      "MedicationHistory": [
        {
          "MedicationName": "Lisinopril",
          "Dosage": "10mg daily",
          "Frequency": "daily",
          "Purpose": "hypertension"
        },
        {
          "MedicationName": "Metformin",
          "Dosage": "500mg twice daily",
          "Frequency": "twice daily",
          "Purpose": "type 2 diabetes"
        },
        {
          "MedicationName": "Atorvastatin",
          "Dosage": "20mg at bedtime",
          "Frequency": "at bedtime",
          "Purpose": "high cholesterol"
        }
      ]
    }
    ```

Run `sdeul --help` for more details.

