{"id":26069996,"url":"https://github.com/sealambda/unit-text","last_synced_at":"2025-04-11T18:50:47.179Z","repository":{"id":281228098,"uuid":"935466090","full_name":"sealambda/unit-text","owner":"sealambda","description":"Unit tests for plain text - LLM as a copy editor","archived":false,"fork":false,"pushed_at":"2025-03-11T14:21:59.000Z","size":2626,"stargazers_count":34,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T14:44:35.300Z","etag":null,"topics":["agentic-ai","ai","blog","llm","ollama","unit-testing"],"latest_commit_sha":null,"homepage":"https://sealambda.com/products/unit-text/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sealambda.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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}},"created_at":"2025-02-19T13:46:45.000Z","updated_at":"2025-03-25T01:49:48.000Z","dependencies_parsed_at":"2025-03-07T18:36:06.590Z","dependency_job_id":null,"html_url":"https://github.com/sealambda/unit-text","commit_stats":null,"previous_names":["sealambda/unit-text"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sealambda%2Funit-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sealambda%2Funit-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sealambda%2Funit-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sealambda%2Funit-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sealambda","download_url":"https://codeload.github.com/sealambda/unit-text/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248464053,"owners_count":21108209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["agentic-ai","ai","blog","llm","ollama","unit-testing"],"created_at":"2025-03-08T23:06:54.629Z","updated_at":"2025-04-11T18:50:47.162Z","avatar_url":"https://github.com/sealambda.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eunit-text\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eUnit tests for plain text\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca  href=\"https://pypi.org/project/unit-text/\"\u003e\n        \u003cimg alt=\"CI\" src=\"https://img.shields.io/pypi/v/unit-text.svg?style=flat-round\u0026logo=pypi\u0026logoColor=white\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![unit-text logo](./docs/img/logo.png)\n\n\u003c/div\u003e\n\n---\n\nDon't let LLMs write blog posts for you. Do your research, bring your own voice,\nand use LLMs to criticise and iterate on your writing.\n\n## 🤌 Why unit-text?\n\nIf you're a developer like us:\n\n- You're probably aware you should write more (either because your leadership asks for it,\n  or because you'd like to be invited as a conference speaker, or \u003cinsert your own reason here\u003e...)\n- You don't know what to write about.\n- You have considered letting ChatGPT write blog posts for you.\n\nIf you tried the last option (or read anything on the Internet in the past 2 years)\nyou would also know why it's not really that good of an idea.\n\nSure, you may get a perfectly good post, but it won't be your own.\n\n`unit-text` applies the concept of unit tests to prose. You are the one writing, the LLM is just your critic.\n\nFirst, you define a goal, the audience you have in mind,\nand what you wanted them to do differently after they read your post.\nThen, you start writing and iterating on your draft. `unit-text` gives you feedback: you run _tests_\nto validate whether your draft is going in the right direction.\n\nAn AI copy editor, you could say.\n\n## ⚙️ Installation\n\n[We recommend](https://sealambda.com/blog/hygienic-python-in-2025) [uv](https://github.com/astral-sh/uv) to run the CLI.\n\n```bash\n# to run the CLI straight away\nuvx unit-text --help\n\n# or if you prefer to install it\nuv tool install unit-text\n```\n\nYou may of course also use `pip` to install the CLI - or `pipx` if you prefer to install it in an isolated environment.\n\n```bash\npipx install unit-text\n\n# ...or if you like to live on the edge\npip install unit-text\n```\n\n## 🔨 Usage\n\n### Requirements\n\nEither:\n\n- [Ollama](https://ollama.com) must be running locally;\n- `OLLAMA_HOST` should point to an Ollama server.\n\n```bash\n# To generate a blog idea\nunit-text ideate\n\n# To validate the working draft\nunit-text test \u003cpath-to-the-draft.md\u003e\n```\n\n### API\n\nThe package also provides a FastAPI server for programmatic access:\n\n```bash\n# Start the development server\nuv run fastapi dev ./src/unit_text/api\n\n# Start the production server\nuv run fastapi run ./src/unit_text/api\n\n# or for convenience\nuv run unit-text-api\n```\n\nThe server exposes a `/test` endpoint that accepts POST requests with two files:\n\n- `file`: Your draft text file\n- `config`: Your idea configuration JSON file\n\nExample using curl:\n\n```bash\ncurl -X POST http://localhost:8000/test \\\n  -F \"file=@draft.md\" \\\n  -F \"config=@unit-text.json\"\n```\n\n## 📝 Process\n\nThe ideation phase is where you define your blog idea. It looks something like this:\n\n![Showing an example blog idea](./docs/img/example/ideate.png)\n\nYour idea is now stored in a `unit-text.json` file, in the current directory.\n\nYou may run `unit-text ideate` again at any time to finetune it.\n\nNow you can start writing, let's say you're writing in a file called `draft.md`.\n\nAt any time, you can run `unit-text test draft.md` to validate it.\nInitially, it may look something like this:\n\n![Showing a failing test execution](./docs/img/example/01.png)\n\nKeep iterating on your draft, based on feedback from `unit-text`, until it passes all tests:\n\n![Showing a passing test execution](./docs/img/example/03.png)\n\n## 💻 Contributing\n\nIf you want to contribute to the project, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) file.\n\nIt contains information on how to set up your development environment, submit issues, and create pull requests.\n\n## 📜 License\n\nThis project is licensed under the AGPLv3 License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsealambda%2Funit-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsealambda%2Funit-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsealambda%2Funit-text/lists"}