{"id":37073894,"url":"https://github.com/chigwell/leaderboard-summarizer","last_synced_at":"2026-01-14T08:40:52.307Z","repository":{"id":329836744,"uuid":"1120778761","full_name":"chigwell/leaderboard-summarizer","owner":"chigwell","description":"Extracts and organizes leaderboard/ranking data from text via smart pattern matching and retries, delivering clean, structured summaries effortlessly.","archived":false,"fork":false,"pushed_at":"2025-12-21T23:24:31.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T10:38:42.365Z","etag":null,"topics":["accuracy-assurance","analysis","consistency","leaderboard","multimedia-exclusion","pattern-matching","ranking","retry-logic","structured-insights","summarization","text-extraction"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/leaderboard-summarizer/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chigwell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-21T23:24:10.000Z","updated_at":"2025-12-21T23:24:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chigwell/leaderboard-summarizer","commit_stats":null,"previous_names":["chigwell/leaderboard-summarizer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chigwell/leaderboard-summarizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fleaderboard-summarizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fleaderboard-summarizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fleaderboard-summarizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fleaderboard-summarizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chigwell","download_url":"https://codeload.github.com/chigwell/leaderboard-summarizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fleaderboard-summarizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accuracy-assurance","analysis","consistency","leaderboard","multimedia-exclusion","pattern-matching","ranking","retry-logic","structured-insights","summarization","text-extraction"],"created_at":"2026-01-14T08:40:51.807Z","updated_at":"2026-01-14T08:40:52.297Z","avatar_url":"https://github.com/chigwell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaderboard Summarizer\n[![PyPI version](https://badge.fury.io/py/leaderboard-summarizer.svg)](https://badge.fury.io/py/leaderboard-summarizer)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://static.pepy.tech/badge/leaderboard-summarizer)](https://pepy.tech/project/leaderboard-summarizer)\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)\n\n\n**leaderboard-summarizer** is a lightweight Python package that extracts structured summaries and analyses from free‑form text describing leaderboards, rankings, or score tables.  \nIt leverages LLM pattern matching (via `llmatch`) to ensure the extracted data matches a predefined regular expression, providing reliable, machine‑readable output without the need to manually parse raw documents.\n\n---\n\n## Features\n\n- **One‑function API** – just call `leaderboard_summarizer(...)`.\n- **Built‑in LLM7 support** – defaults to `ChatLLM7` from the `langchain_llm7` package.\n- **Pluggable LLMs** – pass any LangChain‑compatible `BaseChatModel` (OpenAI, Anthropic, Google, etc.).\n- **Robust pattern matching** – uses a compiled regex to validate and extract the result.\n- **Zero‑configuration fallback** – works out‑of‑the‑box with a free LLM7 API key.\n\n---\n\n## Installation\n\n```bash\npip install leaderboard_summarizer\n```\n\n---\n\n## Quick Start\n\n```python\nfrom leaderboard_summarizer import leaderboard_summarizer\n\n# Minimal usage – LLM7 will be used automatically (API key read from LLM7_API_KEY)\ntext = \"\"\"\nTop players this week:\n1️⃣ Alice – 1500 pts\n2️⃣ Bob – 1450 pts\n3️⃣ Carol – 1400 pts\n\"\"\"\n\nsummary = leaderboard_summarizer(user_input=text)\nprint(summary)\n```\n\n### Using a custom LLM\n\nYou can provide any LangChain `BaseChatModel` instance that follows the same interface.\n\n#### OpenAI\n\n```python\nfrom langchain_openai import ChatOpenAI\nfrom leaderboard_summarizer import leaderboard_summarizer\n\nllm = ChatOpenAI(model=\"gpt-4o-mini\")\nsummary = leaderboard_summarizer(user_input=\"...\", llm=llm)\n```\n\n#### Anthropic\n\n```python\nfrom langchain_anthropic import ChatAnthropic\nfrom leaderboard_summarizer import leaderboard_summarizer\n\nllm = ChatAnthropic(model=\"claude-3-haiku-20240307\")\nsummary = leaderboard_summarizer(user_input=\"...\", llm=llm)\n```\n\n#### Google Gemini\n\n```python\nfrom langchain_google_genai import ChatGoogleGenerativeAI\nfrom leaderboard_summarizer import leaderboard_summarizer\n\nllm = ChatGoogleGenerativeAI(model=\"gemini-1.5-flash\")\nsummary = leaderboard_summarizer(user_input=\"...\", llm=llm)\n```\n\n### Supplying an explicit LLM7 API key\n\n```python\nfrom leaderboard_summarizer import leaderboard_summarizer\n\nsummary = leaderboard_summarizer(\n    user_input=\"...\",\n    api_key=\"your_llm7_api_key\"\n)\n```\n\n---\n\n## API Reference\n\n```python\nleaderboard_summarizer(\n    user_input: str,\n    llm: Optional[BaseChatModel] = None,\n    api_key: Optional[str] = None\n) -\u003e List[str]\n```\n\n| Parameter   | Type                     | Description |\n|-------------|--------------------------|-------------|\n| `user_input`| `str`                    | Free‑form text that contains leaderboard or ranking information. |\n| `llm`       | `Optional[BaseChatModel]`| A LangChain‑compatible chat model. If omitted, the function creates a `ChatLLM7` instance automatically. |\n| `api_key`   | `Optional[str]`         | LLM7 API key. If not provided, the function looks for the `LLM7_API_KEY` environment variable, falling back to a placeholder `\"None\"` (which triggers an error from the service). |\n\n**Return value** – a list of strings extracted from the input text that match the internal regex pattern defined in `leaderboard_summarizer.prompts.pattern`.\n\n---\n\n## How It Works\n\n1. **Prompt Construction** – System and human prompts (defined in `leaderboard_summarizer.prompts`) guide the LLM to produce output that conforms to a strict regex.\n2. **LLM Call** – `llmatch` sends the prompts to the chosen LLM.\n3. **Pattern Validation** – The raw LLM response is checked against the compiled regular expression.\n4. **Extraction** – If the response matches, the captured groups are returned as a list; otherwise a `RuntimeError` is raised.\n\n---\n\n## Environment Variables\n\n- `LLM7_API_KEY` – API key for the default LLM7 service. You can obtain a free key at https://token.llm7.io/.\n\n---\n\n## License\n\nThis project is licensed under the MIT License.\n\n---\n\n## Contributing \u0026 Support\n\n- **Issue Tracker:** https://github.com/chigwell/leaderboard-summarizer/issues  \n- **Author:** Eugene Evstafev – [hi@eugene.plus](mailto:hi@eugene.plus)  \n- **GitHub:** https://github.com/chigwell\n\nFeel free to open issues, submit pull requests, or contact the author for feature requests and bug reports.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fleaderboard-summarizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchigwell%2Fleaderboard-summarizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fleaderboard-summarizer/lists"}