{"library":"pdiff","title":"Pdiff: Pretty side-by-side diff","description":"Pdiff is a command-line utility for generating pretty side-by-side differences between two text files. It is inspired by `ydiff` and `icdiff`, focusing on enhancing readability with color highlighting. The current version is 1.1.5, and it is actively maintained with infrequent but consistent updates.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pdiff"],"cli":{"name":"pdiff","version":"pdiff 1.1.5"}},"imports":["This library is primarily a command-line tool and does not expose a Python API for direct import and programmatic use within Python scripts. It should be invoked via a subprocess if used from Python."],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import subprocess\nimport os\n\n# Create dummy files for demonstration\nfile1_content = \"\"\"Line 1: Hello world\nLine 2: This is a test file.\nLine 3: Some text that is different.\nLine 4: Common line.\n\"\"\"\n\nfile2_content = \"\"\"Line 1: Hello world!\nLine 2: This is a modified test file.\nLine 3: Completely new line here.\nLine 4: Common line.\nLine 5: An extra line in file2.\n\"\"\"\n\nwith open('file1.txt', 'w') as f:\n    f.write(file1_content)\n\nwith open('file2.txt', 'w') as f:\n    f.write(file2_content)\n\nprint(\"Running pdiff on file1.txt and file2.txt:\\n\")\n\ntry:\n    # Execute pdiff as a subprocess\n    # Use text=True (or universal_newlines=True for older Python) to capture stdout as string\n    # The '--' separates options from filenames, useful if filenames start with '-' or similar.\n    result = subprocess.run(['pdiff', '--', 'file1.txt', 'file2.txt'], capture_output=True, text=True, check=True)\n    print(result.stdout)\nexcept subprocess.CalledProcessError as e:\n    print(f\"Error running pdiff: {e.stderr}\")\nexcept FileNotFoundError:\n    print(\"Error: 'pdiff' command not found. Please ensure pdiff is installed and in your PATH.\")\nfinally:\n    # Clean up dummy files\n    if os.path.exists('file1.txt'):\n        os.remove('file1.txt')\n    if os.path.exists('file2.txt'):\n        os.remove('file2.txt')\n","lang":"python","description":"Pdiff is invoked from the command line. This quickstart demonstrates how to use `subprocess.run` in Python to execute `pdiff` and capture its output, comparing two temporary text files. Remember to have `pdiff` installed and available in your system's PATH for this to work.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"1.1.5","pypi_latest":"1.1.5","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.6,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"18.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"19M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"19.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.5M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.5,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pdiff","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.7,"import_time_s":null,"mem_mb":null,"disk_size":"18M"}]}}