{"id":22180747,"url":"https://github.com/jftuga/csv_word_merge","last_synced_at":"2025-03-24T19:15:37.902Z","repository":{"id":117698924,"uuid":"364106048","full_name":"jftuga/csv_word_merge","owner":"jftuga","description":"Merge CSV fields into a MS Word template","archived":false,"fork":false,"pushed_at":"2021-05-04T11:07:55.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-29T23:29:59.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jftuga.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":"2021-05-04T01:18:58.000Z","updated_at":"2023-11-27T01:01:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"f1947730-7489-4961-8a7b-9917ad5d9f78","html_url":"https://github.com/jftuga/csv_word_merge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fcsv_word_merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fcsv_word_merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fcsv_word_merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fcsv_word_merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jftuga","download_url":"https://codeload.github.com/jftuga/csv_word_merge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245334899,"owners_count":20598386,"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":[],"created_at":"2024-12-02T09:19:31.278Z","updated_at":"2025-03-24T19:15:37.881Z","avatar_url":"https://github.com/jftuga.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csv_word_merge\nMerge CSV fields into a MS Word template\n\n**Note:** I threw this together in a couple of hours to help a friend, so it is not as complete as my other projects.\n* Error checking could be improved.\n\n## Description\nThis program allows you to merge rows in a CSV file into a MS Word document.  A PDF file is also saved.\n\n* The first row of the CSV file should contain a header.\n* Example: `Email,First,Last`\n\n* The MS Word document should then contain, case-sensative *macros* with underscores:\n* `_Email_`\n* `_First_`\n* `_Last_`\n\nCreated files are saved via the `-C` switch (note the capital `C`).  If your CSV file has a field called `Email`, then you could use `-C Email`.  There would then be two newly created files for `user@example.com`:\n* `user@example.com.docx`\n* `user@example.com.pdf`\n\n## Requirements\n\n* tested with `Python 3.9`\n* pip install python-docx\n* pip install docx2pdf\n\n## Usage\n```\nusage: csv_word_merge.py [-h] --csv CSV --col COL --dest DEST [--version]\n                         wordfile\n\nMerge CSV fields into a MS Word template\n\npositional arguments:\n  wordfile              MS Word file with macros\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --csv CSV, -c CSV     csv file containing macros\n  --col COL, -C COL     column name for output PDF\n  --dest DEST, -d DEST  destination folder\n  --version, -v         display version and then exit\n\n```\n\n## Example\n\n* csv file: `clients.csv`:\n\n| ID | First\n|----|-----|\n| 12 | Bubba |\n\n\n* col: use a column named `ID` to name the output files\n* dest: save both `docx` and `pdf` files to this directory, in this case a `surveys` folder\n* word document: `template.docx`, which contains a `_First_` macro\n\n```\npython3 csv_word_merge.py --csv clients.csv --col ID --dest surveys template.docx\n```\n\n* In the `surveys` directoy, you should have 2 files, with `_First_` substituted out for `Bubba`\n* `12.docx`\n* `12.pdf`\n\n## LICENSE\n* [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fcsv_word_merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjftuga%2Fcsv_word_merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fcsv_word_merge/lists"}