{"id":31742882,"url":"https://github.com/tomasvana10/commits2pdf","last_synced_at":"2025-10-09T11:19:51.010Z","repository":{"id":230341449,"uuid":"778742218","full_name":"tomasvana10/commits2pdf","owner":"tomasvana10","description":"Convert Git commits to a PDF","archived":false,"fork":false,"pushed_at":"2024-07-05T13:08:43.000Z","size":552,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-25T12:36:06.381Z","etag":null,"topics":["cli","commits","git","multimedia","pdf","pycairo","python-package","python3"],"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/tomasvana10.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}},"created_at":"2024-03-28T10:07:40.000Z","updated_at":"2025-01-12T18:12:00.000Z","dependencies_parsed_at":"2024-05-04T03:21:42.438Z","dependency_job_id":"7d5b63ef-ae51-47e3-9d4a-6ce7cb0073e9","html_url":"https://github.com/tomasvana10/commits2pdf","commit_stats":null,"previous_names":["tomasvana10/commits2pdf"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/tomasvana10/commits2pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasvana10%2Fcommits2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasvana10%2Fcommits2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasvana10%2Fcommits2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasvana10%2Fcommits2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasvana10","download_url":"https://codeload.github.com/tomasvana10/commits2pdf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasvana10%2Fcommits2pdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001290,"owners_count":26083058,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","commits","git","multimedia","pdf","pycairo","python-package","python3"],"created_at":"2025-10-09T11:19:49.591Z","updated_at":"2025-10-09T11:19:50.992Z","avatar_url":"https://github.com/tomasvana10.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n  # commits2pdf\n  ![Licence](https://img.shields.io/badge/licence-MIT-green?style=flat?logo=licence)\n  [![PyPI version](https://img.shields.io/pypi/v/commits2pdf?style=flat-square)](https://pypi.org/project/commits2pdf/)\n  [![Publish to PyPI.org](https://github.com/tomasvana10/commits2pdf/actions/workflows/publish.yml/badge.svg)](https://github.com/tomasvana10/commits2pdf/actions/workflows/publish.yml)\n  [![Release](https://img.shields.io/github/v/release/tomasvana10/commits2pdf?logo=github)](https://github.com/tomasvana10/commits2pdf/releases/latest)\n  [![Issues](https://img.shields.io/github/issues-raw/tomasvana10/commits2pdf.svg?maxAge=25000)](https://github.com/tomasvana10/commits2pdf/issues)\n  [![CodeQL](https://github.com/tomasvana10/commits2pdf/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/tomasvana10/commits2pdf/actions/workflows/github-code-scanning/codeql)\n  [![Tests](https://github.com/tomasvana10/commits2pdf/actions/workflows/tox-tests.yml/badge.svg)](https://github.com/tomasvana10/commits2pdf/actions/workflows/tox-tests.yml)\n\n\u003c/div\u003e\n\nVisualise a Git repository's commit history in PDF form via the command-line\n\n![ezgif-pdf-tutorial](https://github.com/tomasvana10/commits2pdf/assets/124552709/fcc4b5da-2326-4405-80fe-cf984f61129c)\n\n## Dependencies\n`GitPython` `fpdf` `progressbar` `pathvalidate`\n\n`pycairo` (used for deprecated PDF generation method, must be installed manually)\n\n## Installation\n\u003e [!IMPORTANT]\n\u003e Installing `commits2pdf` requires Python and pip.\n\u003e If you have Python installed without pip, click **[here](https://pip.pypa.io/en/stable/installation/)** to install it.\u003cbr\u003e\u003cbr\u003e\n\u003e If you do not have Python installed, download the installer **[here](https://www.python.org/downloads/)**, then refer to the previous link on how to install pip.\u003cbr\u003e\u003cbr\u003e\n\u003e Additionaly, `commits2pdf` requires Git for `gitpython` functionality. Install it **[here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)**.\n\n\u003e [!TIP]\n\u003e If using `python` or `pip` doesn't work, try using `python3` or `pip3`.\n\n1. Make a virtual environment and activate it (recommended):\n\n    - Before you make a virtual environment, you should change your current directory to the folder of your repository. If you don't know how, read [Changing your terminal's directory](#changing-your-terminals-directory).\n    - If you are on Windows and you cannot activate the virtual environment, try running `Set-ExecutionPolicy Unrestricted -Scope Process` and try again.\n```\npip install virtualenv\npython -m venv venv\nMacOS/Unix: source venv/bin/activate\nWindows: venv\\scripts\\activate\n```\n2. Install the package in your system directory/virtual environment:\n```\npip install -U commits2pdf\n```\nor, install the package in your home directory if you aren't using a virtual environment:\n```\npip install --user -U commits2pdf\n```\n3. You can deactivate your virtual environment when you are done:\n```\ndeactivate\n```\n\n\u003e [!TIP]\n\u003e **If you encounter errors with building `pycairo`, click [here](https://stackoverflow.com/a/76175684/23245953)**\n\n## Changing your terminal's directory\n1. Open your terminal\n2. Find your repository's folder\n3. (a) On Windows/Linux: Open the folder, press `CTRL+L`, then press `CTRL+C`. Alternatively, right click on the folder and click `Copy as path`.\n3. (b) On MacOS: Right click on the folder, hold `option` (`⌥`) and click `Copy \u003cfolder name\u003e as Pathname`\n\nThen, in your terminal, run `cd \u003cthe path you copied\u003e` (paste in the path with `CTRL+V` or `CMD+V`).\n\n## Command-line parameters\nThere are many ways to configure the process of PDF generation through command line flags. For a brief introduction on how to use these flags, read [Usage](#usage)\n\n\u003cdetails\u003e\u003csummary\u003ePositional Flags\u003c/summary\u003e\n\n`owner` : The owner of the git repository. Required.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eOptional Flags\u003c/summary\u003e\n                        \n  `-o`, `--output` : Directory path to your PDF output. Set to `.` (your current directory) by default. Will be created if it does not exist. Example: `./work/my_pdfs`\n  \n  `-n`, `--name` : The name of your outputted PDF file. Set to `\u003crepo_name\u003e-commit_report` by default.\n  \n  `-b`, `--branch` : The repository branch. Set to `main` by default.\n                        \n  `-a`, `--authors` : Filter commits from a comma-separated list of authors. Format: `\u003cauthor@email.com\u003e` OR `\u003cauthor1@email.com,author2@email.com\u003e` etc. Set to `all authors` by default.\n                        \n  `-s`, `--start-date` : Filter from start date of commits. Format: `d/m/YYYY`. Example: `5/12/2023`\n                        \n  `-e`, `--end-date` : Filter to end date of commits. Format: `d/m/YYYY`. Example: `5/12/2023`\n                        \n  `-r`, `--reverse` : Output the commits from newest to oldest. Set to `oldest to newest` by default\n  \n  `-d`, `--dark` : Toggle dark mode for the output PDF. Set to `light` by default.\n  \n  `-po`, `--prevent-open` : Prevent commits2pdf from automatically opening the directory the PDF was created in.\n  \n  `-sc`, `--scaling` : Set the scaling of the output PDF. Only available with `-gen2a` and `-gen2b`.\n                        \n  `-in`, `--include` : Include commits with the given string sequences in their title or description. Format: `\u003cstring1\u003e` OR `\u003cstring1,string2\u003e`. Whitespace sensitive and case insensitive. NOTE: This query is performed BEFORE excluding commits.\n                        \n  `-ex`, `--exclude` : Exclude commits with the given string sequences in their title or description. Format: `\u003cstring1\u003e` OR `\u003cstring1,string2\u003e`. Whitespace sensitive and case insensitive.\n                        \n  `-q`, `--quiet` : Suppress all logger messages except for errors.\n  \n  `-gen1`, `--pdf-gen-1 ` : PDF rendering implementation with `pycairo`.\n  \n  `-gen2a`, `--pdf-gen-2a` : The first PDF rendering implementation with `fpdf`.\n  \n  `-gen2b`, `--pdf-gen-2b` : The second PDF rendering implementation with `fpdf`. The default option.\n  \n  `-rp`, `--repo-path` : Path to your repository directory. Set to `.` (your current directory) by default.\n                        \n  `-fc`, `--repo-from-clone` : Clone a repo into the working directory and generate the commits PDF from it automatically. Format: `\u003crepo name\u003e` (case insensitive).\n                        \n  `-nc`, `--newest-n-commits` : Select the newest n number amount of commits to include after filtering.\n                        \n  `-oc`, `--oldest-n-commits` : Select the oldest n number amount of commits to include after filtering.\n\n\u003c/details\u003e\n\n## Usage\n\n\u003e [!TIP]\n\u003e If the value you are providing for a given argument/flag includes spaces, wrap in it quotations (\"\") to ensure it is parsed properly.\n\n**Usage example #1**\n```\nc2p tomasvana10\n```\n\u003e Output a PDF to your current directory (assuming it is a git repository that is owned by `tomasvana10`).\n\n\u003cbr\u003e**Usage example #2**\n```\nc2p tomasvana10 -o .. -rp ./my_repo -n \"new_name.pdf\"\n```\n\u003e Output a PDF (overriding its name to `new_name`) to the parent directory, selecting `./my_repo` as your git repository to access the commits from.\n\n\u003cbr\u003e**Usage example #3**\n```\nc2p tomasvana10 -nc 10 -in \"javascript,build\" -ex \"testing\"\n```\n\u003e Output a PDF to the current directory, displaying the newest 10 commits after filtering commits that contain \"javascript\" and/or \"build\" in their title or description and do not contain \"testing\".\n\n\u003cbr\u003e**Usage example #4**\n```\nc2p devguarv -fc Yr-12-HSC-SDD-Task-2 -e 28/4/2024\n```\n\u003e Clone the repo `Yr-12-HSC-SDD-Task-2` into the current directory and output a PDF into the same place after filtering commits that were made up to `28/4/2024`.\n\n## PDF generation implementations\n### pycairo (gen1 - deprecated)\n👍 Fast\n\n👎 Cannot write multipage commits\n\n👎 Looks like crap\n\n👎 No hyperlinks, therefore the entire link to a commit's diff is displayed\n\n### fpdf (gen2a)\n👍 Fast\n\n👍 Can be scaled with the `-sc \u003cfloat\u003e` argument\u003c\n\n👍 Sleek design\n\n👍 Information title page\n\n👍 Contains hyperlinks\n\n👍 Stores PDF metadata\n\n👎 Inconsistent page breaks, a general limitation with FPDF when trying to fit as many whole commits on a single page\n\n### fpdf (gen2b - Default)\n👍 Same as `gen2a` but with accurate page breaking\n\n👎 Slow when generating large amounts of commits (generally, it is a good idea to enable `-gen2a` when drawing over 5000 commits)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasvana10%2Fcommits2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasvana10%2Fcommits2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasvana10%2Fcommits2pdf/lists"}