{"id":37065588,"url":"https://github.com/uguudei/diffstrings","last_synced_at":"2026-01-14T07:40:44.950Z","repository":{"id":62090282,"uuid":"557081594","full_name":"Uguudei/diffstrings","owner":"Uguudei","description":"Show difference of strings in color","archived":false,"fork":false,"pushed_at":"2022-12-12T10:27:14.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-30T23:36:46.791Z","etag":null,"topics":["beginners-friendly","difflib","hacktoberfest","jupyter-color","nlp","python-colored-output","python-console-color"],"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/Uguudei.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}},"created_at":"2022-10-25T03:26:19.000Z","updated_at":"2022-12-01T03:06:48.000Z","dependencies_parsed_at":"2023-01-27T17:45:31.450Z","dependency_job_id":null,"html_url":"https://github.com/Uguudei/diffstrings","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Uguudei/diffstrings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uguudei%2Fdiffstrings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uguudei%2Fdiffstrings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uguudei%2Fdiffstrings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uguudei%2Fdiffstrings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Uguudei","download_url":"https://codeload.github.com/Uguudei/diffstrings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uguudei%2Fdiffstrings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["beginners-friendly","difflib","hacktoberfest","jupyter-color","nlp","python-colored-output","python-console-color"],"created_at":"2026-01-14T07:40:44.191Z","updated_at":"2026-01-14T07:40:44.936Z","avatar_url":"https://github.com/Uguudei.png","language":"Python","readme":"# diffstrings\n\n[![Test](https://github.com/Uguudei/diffstrings/actions/workflows/test.yml/badge.svg)](https://github.com/Uguudei/diffstrings/actions/workflows/test.yml)\n[![Publish to PyPI](https://github.com/Uguudei/diffstrings/actions/workflows/publish.yml/badge.svg)](https://github.com/Uguudei/diffstrings/actions/workflows/publish.yml)\n[![Publish to TestPyPI](https://github.com/Uguudei/diffstrings/actions/workflows/publish-testpypi.yml/badge.svg)](https://github.com/Uguudei/diffstrings/actions/workflows/publish-testpypi.yml)\n[![PyPi Version](https://img.shields.io/pypi/v/diffstrings?color=blue)](https://pypi.org/project/diffstrings/)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/diffstrings)](https://pypi.org/project/diffstrings/)\n[![License](https://img.shields.io/github/license/Uguudei/diffstrings)](https://github.com/Uguudei/diffstrings/blob/main/LICENSE)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat\u0026labelColor=ef8336)](https://pycqa.github.io/isort/)\n\nShow difference of strings in color. It works on both terminal and ipython.\n\nIt extends difflib.SequenceMatcher class and provides a direct function too.\n\n## Installation\n\n```python\npip install diffstrings\n```\n\n## API\n\n### Example Result\n\n![Colored diff strings](https://user-images.githubusercontent.com/1560166/199187551-fa54c4cc-11eb-40bc-8c09-f227979dd4e2.png)\n\nColor explanation:\n\n- Green: to add\n- Yellow: to replace. (Remove yellow colored then add with green colored strings)\n- Red: to be removed\n\n### Example texts\n\n```bash\n# Truth text to compare with\ntruth = \"\"\"Lorem ipsum dolor sit amet,consectetur adipiscing elit,  sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.f\"\"\"\n\n# Supposedly wrong text to compare\npredict = \"\"\"Lorem furio dlfgor sit amet, consectetur apiscbgfing elit, sed do eiusmod tempor inciddfbunt ut labore et ddslore magna aliqua. Ut enim ad minim veniam, quis nostrud exercsfsation ullamco laboris assi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in volbcvbte velit esse cilldm doldsre eu fugiat nulla pafdgatur. Excepteur sint occaecat cupidatat non pident, sunt in culpa qui asafficia desert mollit anim id est lfdgarum.\"\"\"\n```\n\n### Using class\n\n```bash\nfrom diffstrings import SequenceMatcher\n\ns = SequenceMatcher(None, predict, truth, autojunk=False)\nprint(s.diff_strings())\nprint(s.diff_strings(True))\n```\n\n### Using function\n\n```bash\nfrom diffstrings import diff_strings\n\nprint(diff_strings(predict, truth))\nprint(diff_strings(predict, truth, show_change_on_seq2=True))\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuguudei%2Fdiffstrings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuguudei%2Fdiffstrings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuguudei%2Fdiffstrings/lists"}