text-parsematch processes text input with pattern matching and retries to ensure structured, validated output for data extraction and content categorization.
Project description
text-parsematch
A Python package for processing user-provided text input and returning structured, validated output using pattern matching and retries.
Overview
This package ensures consistent and reliable formatting for applications like data extraction, content categorization, or structured response generation, without handling raw media files directly.
Installation
pip install text_parsematch
Usage
from text_parsematch import text_parsematch
user_input = "Example text to process"
response = text_parsematch(user_input)
# To use your own LLM instance:
from langchain_core.language_models import BaseChatModel
from text_parsematch import text_parsematch
llm = BaseChatModel(...) # create your own LLM instance
response = text_parsematch(user_input, llm=llm)
# For LLM7, you can also pass the api key:
from text_parsematch import text_parsematch
response = text_parsematch(user_input, api_key="your_api_key")
# Or use the default LLM7 instance with your api key:
from text_parsematch import text_parsematch
response = text_parsematch(user_input, api_key="your_api_key")
Available LLM Models
By default, this package uses the ChatLLM7 from langchain_llm7. If you want to use another LLM, you can pass your own instance via the llm parameter.
Here are some examples with popular LLMs:
- OpenAI:
from langchain_openai import ChatOpenAI
from text_parsematch import text_parsematch
llm = ChatOpenAI()
response = text_parsematch(user_input, llm=llm)
- Anthropic:
from langchain_anthropic import ChatAnthropic
from text_parsematch import text_parsematch
llm = ChatAnthropic()
response = text_parsematch(user_input, llm=llm)
- Google Generative AI:
from langchain_google_genai import ChatGoogleGenerativeAI
from text_parsematch import text_parsematch
llm = ChatGoogleGenerativeAI()
response = text_parsematch(user_input, llm=llm)
Rate Limits
The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you need higher rate limits, you can pass your own api key via environment variable LLM7_API_KEY or via passing it directly like text-parsematch(user_input, api_key="your_api_key").
Getting a Free API Key
You can get a free API key by registering at https://token.llm7.io/.
Issues
Report issues at: https://github.com/chigwell/text-parsematch
Author
Eugene Evstafev (chigwell) hi@eugene.plus
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file text_parsematch-2025.12.22111249.tar.gz.
File metadata
- Download URL: text_parsematch-2025.12.22111249.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0f4b846a37e446fbaffa6eadebccdb1360d34b4ce94353752e40e5348cdcbe6
|
|
| MD5 |
b36c54ea3f7264063004d6840caec4af
|
|
| BLAKE2b-256 |
2be1770a5fc245eb022e9563ebe2676e4c92a4611357d6c416338217cb2bcb56
|
File details
Details for the file text_parsematch-2025.12.22111249-py3-none-any.whl.
File metadata
- Download URL: text_parsematch-2025.12.22111249-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5d245a8b4e7bb96fd00dd63a2b09faf6efbb1f62b8c828b2707a6407ff72bbc
|
|
| MD5 |
9afabaa4eb918d177ca4f7cd982d9617
|
|
| BLAKE2b-256 |
27935193913c3679ec142e3037d1f3e25b2478f67200cbb71e31bdbc9b80f3b1
|