Skip to content

chigwell/eco-num-extract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

eco-num-extract

PyPI version License: MIT Downloads LinkedIn

Extract structured numerical data from natural phenomenon descriptions using AI-powered pattern matching.

Overview

A Python package that converts qualitative ecological/natural descriptions into structured quantitative insights. Uses llmatch-messages to enforce numerical output schemas from LLM responses.

Installation

pip install eco_num_extract

Usage

Basic Usage

from eco_num_extract import eco_num_extract

# Default usage with LLM7
response = eco_num_extract(
    user_input="The forest had 120 trees with 45% canopy cover and 3.2m average height"
)

Custom LLM Integration

Pass your preferred LLM instance (OpenAI, Anthropic, etc.):

from langchain_openai import ChatOpenAI
from eco_num_extract import eco_num_extract

llm = ChatOpenAI()
response = eco_num_extract(
    user_input="Sample text",
    llm=llm  # Your custom LLM instance
)

Parameters

  • user_input (str): Textual description containing numerical patterns
  • api_key (str, optional): LLM7 API key (defaults to environment variable)
  • llm (BaseChatModel, optional): Custom LLM instance (defaults to ChatLLM7)

Features

  • Regex-enforced numerical output structure
  • Supports any LLM via LangChain interface
  • Environment variable fallback for API keys
  • Free tier compatible with LLM7

Rate Limits

LLM7 free tier provides sufficient throughput. For higher limits:

# Via environment variable
os.environ["LLM7_API_KEY"] = "your_key"

# Or direct parameter
eco_num_extract(api_key="your_key")

Getting Started

  1. Install package
  2. Get free API key at LLM7 Token Dashboard
  3. Process your ecological descriptions

Issues

Report problems at GitHub Issues

Author

Eugene Evstafev - GitHub | Email