{"id":22903986,"url":"https://github.com/json2d/pyneverduplex","last_synced_at":"2025-04-01T07:56:59.460Z","repository":{"id":252979519,"uuid":"841800275","full_name":"json2d/pyneverduplex","owner":"json2d","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-04T07:38:53.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T04:42:09.836Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/json2d.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-08-13T04:22:22.000Z","updated_at":"2025-01-04T07:38:56.000Z","dependencies_parsed_at":"2025-02-07T04:34:17.391Z","dependency_job_id":"23632241-5405-49bc-ae4e-7a990215b63b","html_url":"https://github.com/json2d/pyneverduplex","commit_stats":null,"previous_names":["json2d/pyneverduplex"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fpyneverduplex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fpyneverduplex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fpyneverduplex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fpyneverduplex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/json2d","download_url":"https://codeload.github.com/json2d/pyneverduplex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246604619,"owners_count":20804100,"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-14T02:39:41.383Z","updated_at":"2025-04-01T07:56:59.434Z","avatar_url":"https://github.com/json2d.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `pyneverduplex`\n\n`pyneverduplex` is a Python script that merges two PDF files into a single PDF document. It is designed to merge PDF files that represent the front pages and back pages (reversed) of a stack of double-sided documents fed into a non-duplex scanner, compensating for the lack of duplexness and interleaving the pages into the correct order.\n\n\u003e back pages are reversed because when feeding the scanner it's easier to just flip the entire stack around (along the long side) to the back pages 🔁 instead of flipping each individual page to preserve the order\n\n## Prerequisites\n\n- Python 3.x installed on your system.\n\n## Installation\n\n### Step 1: Clone the Repository\n\nClone this repository to your local machine using:\n\n```bash\ngit clone git@github.com:json2d/pyneverduplex\n```\n\n### Step 2: Navigate to the Project Directory\n\nChange into the project directory:\n\n```bash\ncd pyneverduplex\n```\n\n### Step 3: Set Up a Virtual Environment (Optional)\n\nIt is recommended to use a virtual environment to manage dependencies. You can create and activate a virtual environment using the following commands:\n\n```bash\n# Create a virtual environment\npython -m venv venv\n\n# Activate the virtual environment\n# On Windows\nvenv\\Scripts\\activate\n\n# On macOS/Linux\nsource venv/bin/activate\n```\n\n### Step 4: Install Required Packages\n\nInstall the required Python packages using `pip` and the `requirements.txt` file:\n\n```bash\npip install -r requirements.txt\n```\n\n## Usage\n\n### Step 5: Place Your PDF Files\n\nEnsure you have your PDF files ready. The script expects two files:\n\n- `tmp/front_pages.pdf`: The PDF containing the front pages of the documents.\n- `tmp/back_pages.pdf`: The PDF containing the back pages of the documents.\n\nPlace these files in the same directory as the script, or update the paths in the script if they are located elsewhere.\n\n### Step 6: Run the Script\n\nExecute the script to merge the PDF files:\n\n```bash\npython merge_pdfs.py tmp/front_pages.pdf tmp/back_pages_reversed.pdf tmp/merged_document.pdf\n```\n\nThe script will output a new PDF file named `tmp/merged_document.pdf` with the pages interleaved correctly.\n\nAlso for the sake of brevity:\n\n```bash\npython qmerge_pdfs.py tmp/some_pages.pdf\n```\n\nyields the equivalent to:\n\n```bash\npython merge_pdfs.py tmp/some_pages__f.pdf tmp/some_pages__br.pdf tmp/some_pages.pdf\n```\n\n## Notes\n\n- The script assumes both PDF files have the same number of pages. Ensure that the front and back PDF files match in page count.\n- Modify the paths in the script if your files are located in different directories.\n- Heavy lift by ChatGPT 4o\n  - https://chatgpt.com/share/e193d449-6e4d-4db6-b6de-c6c0518a585a\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fpyneverduplex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjson2d%2Fpyneverduplex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fpyneverduplex/lists"}