Skip to main content

eco-num-extract turns natural science text into structured numeric data using llmatch-guided outputs.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eco_num_extract-2025.12.22085323.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eco_num_extract-2025.12.22085323-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file eco_num_extract-2025.12.22085323.tar.gz.

File metadata

File hashes

Hashes for eco_num_extract-2025.12.22085323.tar.gz
Algorithm Hash digest
SHA256 1107d53a59c1c0b77d494bef12be7d9930600d5e5bb05882cde447c1519f2c86
MD5 db6cdd7be3412b6c6ad24691fdcba220
BLAKE2b-256 c0fa8449c7fbb9f8b02dee0cdf57d84a706358daaa0c75c5b165796082e319b9

See more details on using hashes here.

File details

Details for the file eco_num_extract-2025.12.22085323-py3-none-any.whl.

File metadata

File hashes

Hashes for eco_num_extract-2025.12.22085323-py3-none-any.whl
Algorithm Hash digest
SHA256 16c7831e25d88dcf5da85cd1250ce652c91801790fa926d5d0401896413f26a3
MD5 5b9c082068de9c52ed45e01702a65e09
BLAKE2b-256 2187db5cee46be1add8c03f2b218c888a0dd16b718bff1cfc94d6e9f14f8e741

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page