{"id":17781618,"url":"https://github.com/humangrass/docx-py","last_synced_at":"2026-04-13T11:01:35.258Z","repository":{"id":259546679,"uuid":"875424091","full_name":"humangrass/docx-py","owner":"humangrass","description":"Service for generating documents using templates and context","archived":false,"fork":false,"pushed_at":"2024-10-19T23:56:39.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-13T23:43:46.057Z","etag":null,"topics":["docx","docxtpl","grpc","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/humangrass.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"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":"2024-10-19T23:54:53.000Z","updated_at":"2024-10-24T22:16:10.000Z","dependencies_parsed_at":"2024-10-26T12:07:41.409Z","dependency_job_id":"673a248e-b223-4a66-85c9-45ac508849c1","html_url":"https://github.com/humangrass/docx-py","commit_stats":null,"previous_names":["humangrass/docx-py"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/humangrass/docx-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humangrass%2Fdocx-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humangrass%2Fdocx-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humangrass%2Fdocx-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humangrass%2Fdocx-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humangrass","download_url":"https://codeload.github.com/humangrass/docx-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humangrass%2Fdocx-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31749763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"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":["docx","docxtpl","grpc","python"],"created_at":"2024-10-27T04:03:44.445Z","updated_at":"2026-04-13T11:01:35.242Z","avatar_url":"https://github.com/humangrass.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Document generation service\n\nA microservice for generating documents using templates and transmitted context. It is easy to use, similar to Jinja2\nand Django templates.\n\n## Features\n\n- Generate documents from templates using `docxtpl`\n- gRPC support for efficient communication\n- Supports text, filters, conditions, and loops within templates\n\n## Installation and Setup\n\n### Prerequisites\n\n1. Clone the repository:\n\n```bash\ngit clone git@github.com:humangrass/docx-py.git\n```\n\n2. Ensure you have [python 3.10+](https://www.python.org/downloads/) installed. On UNIX systems, Python may already be\n   installed, but make sure to have pip set up. If not, install it via the following command:\n\n```bash\nsudo apt-get install python3-pip\n```\n\n3. Install project dependencies. It's recommended to use\n   a [virtual environment](https://docs.python.org/3/library/venv.html) for isolation:\n\n```bash\npython -m venv venv\nsource venv/bin/activate   # On Windows use: venv\\Scripts\\activate\npip install -r requirements.txt\n```\n\n4. Set up a PostgreSQL database. For ease of setup, you can use [Docker](https://docs.docker.com/engine/install/) and\n   the example [docker-compose.yml](docker-compose.example.yml) provided in the repository:\n\n```bash\ndocker compose -f docker-compose.example.yml up -d\n```\n\nTo stop the containers:\n\n```bash\ndocker compose -f docker-compose.example.yml down\n```\n\n5. Apply migrations. Make sure the database schema is up-to-date:\n\n```bash\nalembic upgrade head\n```\n\n### Starting the gRPC Server\n\nTo start the gRPC server, run:\n\n```bash\npython app/main.py\n```\n\nThe server will start on port 50051 by default.\n\n### Running the Client Example\n\nThe client example will:\n\n* Add a template to the database.\n* Generate a document using the template and provided context.\n* Remove the template after completion.\n* Save the generated document as generated_document.docx.\n\nTo run the client:\n\n```bash\npython example/client.py\n```\n\n### Template Example\n\nBelow is an example of how your template might look:\n\n![img.png](example/template.png)\n\n### Generated Document Example\n\nHere is an example of the generated document:\n\n![img_1.png](example/generated.png)\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumangrass%2Fdocx-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumangrass%2Fdocx-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumangrass%2Fdocx-py/lists"}