rankextractplus extracts and structures ranked info from text, organizing data for easier comparison and analysis.
Project description
RankExtractPlus
RankExtractPlus is a Python package designed to extract and structure ranked information from unstructured text inputs. It leverages the power of large language models (LLMs) to process text and return structured, ranked outputs.
Features
- Extracts and ranks information from unstructured text
- Uses
llmatch-messagesto ensure structured and consistent outputs - Supports custom LLMs for flexible integration
- Easy-to-use interface with minimal setup
Installation
To install RankExtractPlus, simply run:
pip install rankextractplus
Usage
Basic Usage
from rankextractplus import rankextractplus
user_input = "Text about the best countries at math..."
response = rankextractplus(user_input)
print(response)
Advanced Usage with Custom LLM
You can use any LLM compatible with LangChain. Here are examples with different LLMs:
Using OpenAI
from langchain_openai import ChatOpenAI
from rankextractplus import rankextractplus
llm = ChatOpenAI()
response = rankextractplus(user_input, llm=llm)
print(response)
Using Anthropic
from langchain_anthropic import ChatAnthropic
from rankextractplus import rankextractplus
llm = ChatAnthropic()
response = rankextractplus(user_input, llm=llm)
print(response)
Using Google
from langchain_google_genai import ChatGoogleGenerativeAI
from rankextractplus import rankextractplus
llm = ChatGoogleGenerativeAI()
response = rankextractplus(user_input, llm=llm)
print(response)
Using LLM7 API Key
By default, RankExtractPlus uses ChatLLM7 from langchain_llm7. If you want to use a custom API key, you can pass it directly or set it as an environment variable:
from rankextractplus import rankextractplus
# Using environment variable
import os
os.environ["LLM7_API_KEY"] = "your_api_key"
response = rankextractplus(user_input)
# Or passing it directly
response = rankextractplus(user_input, api_key="your_api_key")
Parameters
user_input(str): The unstructured text input to process.llm(Optional[BaseChatModel]): The LangChain LLM instance to use. If not provided, the defaultChatLLM7will be used.api_key(Optional[str]): The API key for LLM7. If not provided, the environment variableLLM7_API_KEYwill be used.
Rate Limits
The default rate limits for LLM7's free tier are sufficient for most use cases. If you need higher rate limits, you can obtain a free API key by registering at LLM7.
Contributing
If you encounter any issues or have suggestions, please open an issue on GitHub.
Author
- Eugene Evstafev
- Email: hi@eugene.plus
- GitHub: chigwell
License
This project is licensed under the MIT License. See the LICENSE file for details.
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 rankextractplus-2025.12.21231046.tar.gz.
File metadata
- Download URL: rankextractplus-2025.12.21231046.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ea6cd3f9c2204a34bf35bf0de7faee268f64921429386a0184893e534298950
|
|
| MD5 |
575a7778a23a3698ccf2b98bdcae7345
|
|
| BLAKE2b-256 |
d65f96dad931fcac219c4304be3434f551a24461680359453e1fb6140fe6a409
|
File details
Details for the file rankextractplus-2025.12.21231046-py3-none-any.whl.
File metadata
- Download URL: rankextractplus-2025.12.21231046-py3-none-any.whl
- Upload date:
- Size: 4.6 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 |
502dfe2305e976f96681fa9fe50db020bc940daa63090e3a66d55fea7fe3d9fd
|
|
| MD5 |
4bfa6b77a724ade840758a99da84aab3
|
|
| BLAKE2b-256 |
5599073f11e94c0bfaf257d555fbca060718866cef41f0490d71d03efa76774c
|