{"id":19401226,"url":"https://github.com/mishamyrt/cppwriter","last_synced_at":"2026-01-27T13:03:06.685Z","repository":{"id":251671569,"uuid":"822987226","full_name":"mishamyrt/cppwriter","owner":"mishamyrt","description":"✍️ Iterative interface for generating C/C++ code from Python","archived":false,"fork":false,"pushed_at":"2024-07-02T11:10:55.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-24T01:28:13.495Z","etag":null,"topics":["arduino","cpp"],"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/mishamyrt.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-07-02T08:04:17.000Z","updated_at":"2024-07-02T11:10:53.000Z","dependencies_parsed_at":"2024-08-05T00:24:47.155Z","dependency_job_id":"d425ec17-32d5-4148-9a96-0a40eb0ba931","html_url":"https://github.com/mishamyrt/cppwriter","commit_stats":null,"previous_names":["mishamyrt/cppwriter"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mishamyrt/cppwriter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcppwriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcppwriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcppwriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcppwriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mishamyrt","download_url":"https://codeload.github.com/mishamyrt/cppwriter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fcppwriter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28813227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"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":["arduino","cpp"],"created_at":"2024-11-10T11:17:37.383Z","updated_at":"2026-01-27T13:03:06.671Z","avatar_url":"https://github.com/mishamyrt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ writer [![Quality assurance](https://github.com/mishamyrt/cppwriter/actions/workflows/qa.yaml/badge.svg)](https://github.com/mishamyrt/cppwriter/actions/workflows/qa.yaml) [![PyPI version](https://badge.fury.io/py/cppwriter.svg)](https://badge.fury.io/py/cppwriter)\n\nThe library provides an iterative interface for generating C/C++ code from Python.\n\n## Installation\n\n```sh\npip install cppwriter\n```\n\n## Usage\n\n```python\nfrom cppwriter import FileBlock\n\nfile = FileBlock(indent_char=\"  \")\nfile.include(\"stdio.h\", is_global=True)\nfile.line()\nmain = file.function(\"main\", \"int\")\nmain.if_statement(\"PI \u003e 4\").line(\"return 1\")\nmain.line(\"return 0\")\nprint(str(file))\n```\n\nThis will generate the following code:\n\n```c\n#include \u003cstdio.h\u003e\n\nint main() {\n  if (PI \u003e 4) {\n    return 1;\n  }\n  return 0;\n}\n```\n\n## Relationship to cwriter\n\nWhen I started making this library I didn't know about the existence of cwriter. I came across it while searching for a package name, but decided to give up and still finish my version.  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Fcppwriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmishamyrt%2Fcppwriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Fcppwriter/lists"}