{"id":37072181,"url":"https://github.com/chigwell/structquery","last_synced_at":"2026-01-14T08:28:19.409Z","repository":{"id":329774313,"uuid":"1120645054","full_name":"chigwell/structquery","owner":"chigwell","description":"A new package that transforms unstructured text queries into highly structured, search-optimized outputs. The package takes a user's text input, such as a search query or a description of information ","archived":false,"fork":false,"pushed_at":"2025-12-21T16:45:03.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T06:24:41.808Z","etag":null,"topics":["accuracy-improvement","data-structuring","e-commerce-applications","information-retrieval","llmatch-messages","precision-search","query-refinement","relevant-results","research-applications","search-efficiency","search-engine-performance","search-optimization","standardized-input-format","structured-output","text-transformation","unstructured-text-queries"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/structquery/","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-21T16:44:55.000Z","updated_at":"2025-12-21T16:45:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chigwell/structquery","commit_stats":null,"previous_names":["chigwell/structquery"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chigwell/structquery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fstructquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fstructquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fstructquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fstructquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chigwell","download_url":"https://codeload.github.com/chigwell/structquery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fstructquery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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-improvement","data-structuring","e-commerce-applications","information-retrieval","llmatch-messages","precision-search","query-refinement","relevant-results","research-applications","search-efficiency","search-engine-performance","search-optimization","standardized-input-format","structured-output","text-transformation","unstructured-text-queries"],"created_at":"2026-01-14T08:28:18.789Z","updated_at":"2026-01-14T08:28:19.397Z","avatar_url":"https://github.com/chigwell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# structquery\n[![PyPI version](https://badge.fury.io/py/structquery.svg)](https://badge.fury.io/py/structquery)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://static.pepy.tech/badge/structquery)](https://pepy.tech/project/structquery)\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)\n\n\n**structquery** is a lightweight Python package that converts unstructured text queries into highly structured, search‑optimized outputs. By leveraging the `llmatch‑messages` utility and a default LLM7 model, the package extracts key elements from user input (e.g., location, difficulty, length) and returns them in a format that is ready for downstream search engines or information‑retrieval pipelines.\n\n---\n\n## ✨ Features\n\n- **One‑line transformation** from free‑form text to a list of structured fields.\n- **Built‑in LLM7 support** (`ChatLLM7` from `langchain_llm7`) with automatic API‑key handling.\n- **Pluggable LLMs** – you can swap in any LangChain‑compatible chat model (OpenAI, Anthropic, Google, etc.).\n- **Regex‑driven output validation** via `llmatch` to guarantee format correctness.\n- **Zero‑config defaults** – works out‑of‑the‑box for common use‑cases.\n\n---\n\n## 📦 Installation\n\n```bash\npip install structquery\n```\n\n---\n\n## 🚀 Quick Start\n\n```python\nfrom structquery import structquery\n\n# Simple call – uses the default ChatLLM7 model\nresponse = structquery(\n    user_input=\"best hiking trails in Colorado\"\n)\n\nprint(response)               # → List of extracted structured strings\n```\n\n### Parameters\n\n| Name       | Type                              | Description |\n|------------|-----------------------------------|-------------|\n| `user_input` | `str` | The raw user query or description you want to structure. |\n| `llm`       | `Optional[BaseChatModel]` | Your own LangChain chat model. If omitted, the package creates a `ChatLLM7` instance automatically. |\n| `api_key`   | `Optional[str]` | LLM7 API key. If omitted, the package reads `LLM7_API_KEY` from the environment; otherwise it falls back to the placeholder `\"None\"` (which triggers an error from the LLM service). |\n\n---\n\n## 🔧 Using a Custom LLM\n\nYou can provide any LangChain‑compatible chat model that inherits from `BaseChatModel`. Below are examples for the most popular providers.\n\n### OpenAI\n\n```python\nfrom langchain_openai import ChatOpenAI\nfrom structquery import structquery\n\nllm = ChatOpenAI(model=\"gpt-4o-mini\")\nresponse = structquery(\n    user_input=\"latest smartphones under $500\",\n    llm=llm\n)\n```\n\n### Anthropic\n\n```python\nfrom langchain_anthropic import ChatAnthropic\nfrom structquery import structquery\n\nllm = ChatAnthropic(model_name=\"claude-3-haiku-20240307\")\nresponse = structquery(\n    user_input=\"affordable vegan meal plan\",\n    llm=llm\n)\n```\n\n### Google Generative AI\n\n```python\nfrom langchain_google_genai import ChatGoogleGenerativeAI\nfrom structquery import structquery\n\nllm = ChatGoogleGenerativeAI(model=\"gemini-1.5-flash\")\nresponse = structquery(\n    user_input=\"top-rated bike touring routes in Europe\",\n    llm=llm\n)\n```\n\n---\n\n## 🔑 LLM7 API Key\n\n- The free tier of LLM7 supplies generous rate limits that satisfy most experimentation and production needs.\n- To obtain a free API key, register at **[https://token.llm7.io/](https://token.llm7.io/)**.\n- You can provide the key in three ways:\n  1. **Environment variable**: `export LLM7_API_KEY=your_key`\n  2. **Direct argument**: `structquery(user_input, api_key=\"your_key\")`\n  3. **Pass a pre‑configured `ChatLLM7` instance** via the `llm` argument.\n\n---\n\n## 🐞 Issues \u0026 Contributions\n\n- **Bug reports / feature requests**: \u003chttps://github.com/chigwell/structquery/issues\u003e\n- Contributions are welcome! Fork the repository, make your changes, and submit a pull request.\n\n---\n\n## 📝 License\n\nDistributed under the MIT License. See the `LICENSE` file for details.\n\n---\n\n## 📧 Contact\n\n**Eugene Evstafev** – [hi@euegne.plus](mailto:hi@euegne.plus)  \nGitHub: \u003chttps://github.com/chigwell\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fstructquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchigwell%2Fstructquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fstructquery/lists"}