Skip to content

jumtra/try-google-langExtract

Repository files navigation

Language Extraction Project

A Python project demonstrating language extraction using the langextract library. This project is set up with uv for dependency management, pytest for testing, mypy for type checking, and ruff for linting.

Installation

  1. Clone the repository:

    git clone https://github.com/jumtra/try-google-langExtract.git # Assuming this is the correct repo name
    cd try-google-langExtract
  2. Create and activate a virtual environment:

    uv venv
    source .venv/bin/activate
  3. Install dependencies:

    uv add --group dev
    uv add
    uv pip install -e .

Usage

This project uses the langextract library to perform language extraction.

To run the main script:

uv run main.py

API Key Configuration

The langextract library, especially when using cloud-hosted models, requires an API key. You must provide this API key via the LANGEXTRACT_API_KEY environment variable.

Example:

export LANGEXTRACT_API_KEY="YOUR_API_KEY_HERE"
uv run main.py

Replace "YOUR_API_KEY_HERE" with your actual langextract API key.

Testing

To run the tests, use pytest:

uv run pytest

This will also generate a coverage report.

Linting and Type Checking

To ensure code quality and consistency, you can run ruff for linting and mypy for type checking:

uv run ruff check .
uv run mypy src/

About

Try LangExtract

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published