Compario
Structured Text Similarity Comparison with Large Language Models
Compario is a Python package that leverages Normalized Compression Distance (NCD) and Large Language Models (LLMs) to perform structured similarity comparisons between textual content. It analyzes user-provided text snippets, computes similarity scores, and returns formatted results—ideal for automated content comparison without processing raw documents directly.
🔧 Installation
Install via pip:
pip install compario
🚀 Quick Start
Basic Usage
from compario import compario
# Example: Compare two text snippets
user_input = """
Text 1: "The quick brown fox jumps over the lazy dog."
Text 2: "A fast brown fox leaps across the sleepy canine."
"""
response = compario(user_input)
print(response)
Custom LLM Integration
By default, Compario uses ChatLLM7 (from langchain_llm7). You can override it with any LangChain-compatible LLM:
Using OpenAI
from langchain_openai import ChatOpenAI
from compario import compario
llm = ChatOpenAI()
response = compario(user_input, llm=llm)
Using Anthropic (Claude)
from langchain_anthropic import ChatAnthropic
from compario import compario
llm = ChatAnthropic()
response = compario(user_input, llm=llm)
Using Google Generative AI
from langchain_google_genai import ChatGoogleGenerativeAI
from compario import compario
llm = ChatGoogleGenerativeAI()
response = compario(user_input, llm=llm)
🔑 API Key & Rate Limits
- Default LLM (LLM7): Uses
LLM7_API_KEYfrom environment variables or falls back to a default key. - Free Tier: Sufficient for most use cases (check LLM7 docs for limits).
- Custom Key: Pass via
api_keyparameter or setLLM7_API_KEYin your environment:compario(user_input, api_key="your_api_key_here")
- Get a Free Key: Register at LLM7
📝 Parameters
| Parameter | Type | Description |
|---|---|---|
user_input |
str |
The text(s) to compare (e.g., multiple snippets separated by newlines). |
api_key |
Optional[str] |
LLM7 API key (defaults to LLM7_API_KEY env var). |
llm |
Optional[BaseChatModel] |
Custom LangChain LLM (e.g., ChatOpenAI, ChatAnthropic). |
📌 Key Features
✅ Pattern Matching + NCD: Combines structured pattern analysis with compression-based similarity. ✅ Flexible LLM Support: Works with any LangChain-compatible model. ✅ No Raw Document Processing: Focuses on comparing extracted text snippets. ✅ Clear Output: Returns structured similarity results.
🐛 Issues & Support
For bugs or feature requests, open an issue on GitHub.
👤 Author
- Eugene Evstafev (@chigwell)
- Email: hi@euegne.plus
Metadata
Release files for compario 2025.12.21102846
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| compario-2025.12.21102846.tar.gz | 4.4 kB | Without provenance | Details for compario-2025.12.21102846.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| compario-2025.12.21102846-py3-none-any.whl | Python 3 | none | any | Details for compario-2025.12.21102846-py3-none-any.whl |
Total release size: 9.3 kB
Release files / compario-2025.12.21102846.tar.gz
| Download URL | compario-2025.12.21102846.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efc712af4f12cb1c43009d94873de1feb2eeae205dc79b2a707fa8b48ab79fe0
|
|
BLAKE2b-256 checksum How to use checksums |
2e3b594a69901c182bb38ac5b9261fd6385a6d9b75179591c104de840102df5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Release files / compario-2025.12.21102846-py3-none-any.whl
| Download URL | compario-2025.12.21102846-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23acae1730bcac315486718c8190d741591845029357a1b61ce8d3d5a3e0a8e3
|
|
BLAKE2b-256 checksum How to use checksums |
dfd6da2f586df8a6ec5895f32122b06dd70ec94a6c5ec104294606dc2fa2b5ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Security for compario 2025.12.21102846
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.