https://github.com/chigwell/rankextractplus
rankextractplus extracts and structures ranked info from text, organizing data for easier comparison and analysis.
https://github.com/chigwell/rankextractplus
consistent-output data-analysis data-comparison data-organization data-summarization formatted-output llm-processing llmatch-messages pattern-matching ranked-information retries structured-data system-prompt text-extraction unstructured-text
Last synced: 17 days ago
JSON representation
rankextractplus extracts and structures ranked info from text, organizing data for easier comparison and analysis.
- Host: GitHub
- URL: https://github.com/chigwell/rankextractplus
- Owner: chigwell
- Created: 2025-12-21T23:10:41.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-12-21T23:11:54.000Z (about 1 month ago)
- Last Synced: 2025-12-23T10:35:48.452Z (about 1 month ago)
- Topics: consistent-output, data-analysis, data-comparison, data-organization, data-summarization, formatted-output, llm-processing, llmatch-messages, pattern-matching, ranked-information, retries, structured-data, system-prompt, text-extraction, unstructured-text
- Language: Python
- Homepage: https://pypi.org/project/rankextractplus/
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RankExtractPlus
[](https://badge.fury.io/py/rankextractplus)
[](https://opensource.org/licenses/MIT)
[](https://pepy.tech/project/rankextractplus)
[](https://www.linkedin.com/in/eugene-evstafev-716669181/)
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-messages` to ensure structured and consistent outputs
- Supports custom LLMs for flexible integration
- Easy-to-use interface with minimal setup
## Installation
To install RankExtractPlus, simply run:
```bash
pip install rankextractplus
```
## Usage
### Basic Usage
```python
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
```python
from langchain_openai import ChatOpenAI
from rankextractplus import rankextractplus
llm = ChatOpenAI()
response = rankextractplus(user_input, llm=llm)
print(response)
```
#### Using Anthropic
```python
from langchain_anthropic import ChatAnthropic
from rankextractplus import rankextractplus
llm = ChatAnthropic()
response = rankextractplus(user_input, llm=llm)
print(response)
```
#### Using Google
```python
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:
```python
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 default `ChatLLM7` will be used.
- `api_key` (Optional[str]): The API key for LLM7. If not provided, the environment variable `LLM7_API_KEY` will 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](https://token.llm7.io/).
## Contributing
If you encounter any issues or have suggestions, please open an issue on [GitHub](https://github.com/chigwell/rankextractplus/issues).
## Author
- **Eugene Evstafev**
- Email: hi@eugene.plus
- GitHub: [chigwell](https://github.com/chigwell)
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.