Extract structured numerical data from natural phenomenon descriptions using AI-powered pattern matching.
A Python package that converts qualitative ecological/natural descriptions into structured quantitative insights. Uses llmatch-messages to enforce numerical output schemas from LLM responses.
pip install eco_num_extractfrom 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"
)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
)user_input(str): Textual description containing numerical patternsapi_key(str, optional): LLM7 API key (defaults to environment variable)llm(BaseChatModel, optional): Custom LLM instance (defaults to ChatLLM7)
- Regex-enforced numerical output structure
- Supports any LLM via LangChain interface
- Environment variable fallback for API keys
- Free tier compatible with LLM7
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")- Install package
- Get free API key at LLM7 Token Dashboard
- Process your ecological descriptions
Report problems at GitHub Issues