{"id":37073097,"url":"https://github.com/chigwell/write-struct","last_synced_at":"2026-01-14T08:34:45.977Z","repository":{"id":329810656,"uuid":"1120720553","full_name":"chigwell/write-struct","owner":"chigwell","description":"write-struct transforms user-submitted text into structured, formatted content for improved readability and consistency.","archived":false,"fork":false,"pushed_at":"2025-12-21T20:03:24.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T08:43:20.930Z","etag":null,"topics":["article-generation","automated-content-formatting","blog-post-structuring","content-consistency","content-formatting","llmatch-messages","predefined-formats","publication-readiness","readability-enhancement","social-media-updates","structural-guidelines","structured-content","text-organization","text-transformation","user-input-processing","writefreely-integration"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/write-struct/","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-21T20:03:14.000Z","updated_at":"2025-12-21T20:03:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chigwell/write-struct","commit_stats":null,"previous_names":["chigwell/write-struct"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chigwell/write-struct","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwrite-struct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwrite-struct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwrite-struct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwrite-struct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chigwell","download_url":"https://codeload.github.com/chigwell/write-struct/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fwrite-struct/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:31:27.429Z","status":"ssl_error","status_checked_at":"2026-01-14T08:31:19.098Z","response_time":107,"last_error":"SSL_read: 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":["article-generation","automated-content-formatting","blog-post-structuring","content-consistency","content-formatting","llmatch-messages","predefined-formats","publication-readiness","readability-enhancement","social-media-updates","structural-guidelines","structured-content","text-organization","text-transformation","user-input-processing","writefreely-integration"],"created_at":"2026-01-14T08:34:45.373Z","updated_at":"2026-01-14T08:34:45.963Z","avatar_url":"https://github.com/chigwell.png","language":"Python","readme":"# write_struct\n[![PyPI version](https://badge.fury.io/py/write-struct.svg)](https://badge.fury.io/py/write-struct)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://static.pepy.tech/badge/write-struct)](https://pepy.tech/project/write-struct)\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)\n\n\n**Transform raw text into structured, formatted content for WriteFreely and beyond.**\n\n`write_struct` is a Python package designed to enhance content creation by automatically converting user-submitted text into well-structured, formatted output. It leverages AI-powered pattern matching to ensure consistency, readability, and publication-ready quality for articles, blog posts, social media updates, and more.\n\n---\n\n## 🚀 Features\n- **Automated text structuring** using AI-driven pattern matching.\n- **Flexible LLM integration** – works with default `ChatLLM7` or any LangChain-compatible model.\n- **Regex-based validation** to enforce output consistency.\n- **Lightweight and efficient** for text-based content processing.\n- **No multimedia handling** – focuses purely on text formatting.\n\n---\n\n## 📦 Installation\n\nInstall via pip:\n\n```bash\npip install write_struct\n```\n\n---\n\n## 🔧 Usage\n\n### Basic Usage (Default LLM7)\n```python\nfrom write_struct import write_struct\n\nuser_input = \"Your raw text here...\"\nresponse = write_struct(user_input)\nprint(response)\n```\n\n### Custom LLM Integration\nYou can replace the default `ChatLLM7` with any LangChain-compatible model (e.g., OpenAI, Anthropic, Google Generative AI):\n\n#### Using OpenAI:\n```python\nfrom langchain_openai import ChatOpenAI\nfrom write_struct import write_struct\n\nllm = ChatOpenAI()\nresponse = write_struct(user_input, llm=llm)\n```\n\n#### Using Anthropic:\n```python\nfrom langchain_anthropic import ChatAnthropic\nfrom write_struct import write_struct\n\nllm = ChatAnthropic()\nresponse = write_struct(user_input, llm=llm)\n```\n\n#### Using Google Generative AI:\n```python\nfrom langchain_google_genai import ChatGoogleGenerativeAI\nfrom write_struct import write_struct\n\nllm = ChatGoogleGenerativeAI()\nresponse = write_struct(user_input, llm=llm)\n```\n\n---\n\n## 🔑 API Key Configuration\n- **Default**: Uses `LLM7_API_KEY` from environment variables.\n- **Manual Override**: Pass the API key directly:\n  ```python\n  response = write_struct(user_input, api_key=\"your_api_key_here\")\n  ```\n- **Free API Key**: Register at [https://token.llm7.io/](https://token.llm7.io/) for LLM7.\n\n---\n\n## 📜 Input Parameters\n| Parameter | Type       | Description                                                                 |\n|-----------|------------|-----------------------------------------------------------------------------|\n| `user_input` | `str`      | Raw text to be structured.                                                  |\n| `api_key`   | `Optional[str]` | LLM7 API key (defaults to `LLM7_API_KEY` env var).                     |\n| `llm`       | `Optional[BaseChatModel]` | Custom LangChain LLM (e.g., `ChatOpenAI`, `ChatAnthropic`). Defaults to `ChatLLM7`. |\n\n---\n\n## 📊 Rate Limits\n- **LLM7 Free Tier**: Sufficient for most use cases.\n- **Upgrade**: For higher limits, use a custom API key or switch to a paid plan.\n\n---\n\n## 📝 License\nMIT License.\n\n---\n\n## 📢 Support \u0026 Issues\nFor bugs, feature requests, or support, open an issue on [GitHub](https://github.com/chigwell/write-struct/issues).\n\n---\n\n## 👤 Author\n**Eugene Evstafev** ([@chigwell](https://github.com/chigwell))\n📧 [hi@euegne.plus](mailto:hi@euegne.plus)\n\n---","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fwrite-struct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchigwell%2Fwrite-struct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fwrite-struct/lists"}