{"id":45292718,"url":"https://github.com/houfu/redlines","last_synced_at":"2026-02-21T03:27:38.001Z","repository":{"id":57460721,"uuid":"458576870","full_name":"houfu/redlines","owner":"houfu","description":"Show the differences between two strings/text as a compact text, in markdown/HTML, in the terminal and more.","archived":false,"fork":false,"pushed_at":"2026-02-07T13:26:37.000Z","size":1195,"stargazers_count":153,"open_issues_count":9,"forks_count":17,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-07T21:47:05.495Z","etag":null,"topics":["diff","hacktoberfest","markdown","python"],"latest_commit_sha":null,"homepage":"https://houfu.github.io/redlines/","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/houfu.png","metadata":{"files":{"readme":"README-PT-BR.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"Code_of_Conduct.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-02-12T16:29:18.000Z","updated_at":"2026-02-06T05:51:34.000Z","dependencies_parsed_at":"2025-10-22T15:20:49.975Z","dependency_job_id":"04a1cb40-0b9c-4b27-8fb1-9f9256d6f66c","html_url":"https://github.com/houfu/redlines","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"d5cb55f5e3bd39866d58b71485081067c3324fe1"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/houfu/redlines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houfu%2Fredlines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houfu%2Fredlines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houfu%2Fredlines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houfu%2Fredlines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houfu","download_url":"https://codeload.github.com/houfu/redlines/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houfu%2Fredlines/sbom","scorecard":{"id":469635,"data":{"date":"2025-08-11","repo":{"name":"github.com/houfu/redlines","commit":"b419b489bfde8d3f07dc4e796cbef98c7c0d3f0d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Code-Review","score":1,"reason":"Found 2/18 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":10,"reason":"12 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/docs.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docs.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/python-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-package.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/python-package.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-package.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/python-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/python-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/python-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/houfu/redlines/python-publish.yml/main?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/docs.yml:14","Warn: no topLevel permission defined: .github/workflows/python-package.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/python-publish.yml:22","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.5.1 not signed: https://api.github.com/repos/houfu/redlines/releases/184162362","Warn: release artifact v0.5.0 not signed: https://api.github.com/repos/houfu/redlines/releases/183184358","Warn: release artifact v0.5.1 does not have provenance: https://api.github.com/repos/houfu/redlines/releases/184162362","Warn: release artifact v0.5.0 does not have provenance: https://api.github.com/repos/houfu/redlines/releases/183184358"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/python-publish.yml:25"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: GHSA-gmj6-6f8f-6699","Warn: Project is vulnerable to: GHSA-h5c8-rqwp-cp95","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: GHSA-5vgj-ggm4-fg62","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T13:31:02.511Z","repository_id":57460721,"created_at":"2025-08-19T13:31:02.511Z","updated_at":"2025-08-19T13:31:02.511Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29672704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T03:11:15.450Z","status":"ssl_error","status_checked_at":"2026-02-21T03:10:34.920Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["diff","hacktoberfest","markdown","python"],"created_at":"2026-02-21T03:27:37.216Z","updated_at":"2026-02-21T03:27:37.994Z","avatar_url":"https://github.com/houfu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Translation Date:** 2025-10-29\n**Original English File:** [README.md](https://github.com/houfu/redlines/blob/master/README.md)\n*This is a translation. For the most current version, please refer to the English file.*\n\n---\n\n**Data da Tradução:** 29-10-2025\n**Arquivo Original em Inglês:** [README.md](https://github.com/houfu/redlines/blob/master/README.md)\n*Esta é uma tradução. Para a versão mais atualizada, por favor, consulte o arquivo em inglês.*\n\n---\n# Redlines\n![Repository banner image](repository-open-graph.png)\n![PyPI - Version](https://img.shields.io/pypi/v/redlines)\n![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/houfu/redlines)\n![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/houfu/redlines)\n![PyPI - License](https://img.shields.io/pypi/l/redlines)\n\n`Redlines` compara duas strings/textos e produz uma saída estruturada mostrando suas diferenças. As alterações são representadas com tachados e destaques, similar ao controle de alterações do Microsoft Word. A saída inclui informações detalhadas sobre mudanças, posições e estatísticas para uso programático.\n\nSuporta múltiplos formatos de saída: **JSON** (padrão, com dados estruturados de alterações e estatísticas), **Markdown**, **HTML** e **rich** (exibição em terminal).\n\n## Início Rápido\n\n```bash\n# Instalar\npip install redlines\n\n# CLI: Comparar dois textos (saída em JSON por padrão)\nredlines \"The quick brown fox jumps over the lazy dog.\" \"The quick brown fox walks past the lazy dog.\"\n\n# Python: Comparar e obter markdown\nfrom redlines import Redlines\ntest = Redlines(\n    \"The quick brown fox jumps over the lazy dog.\",\n    \"The quick brown fox walks past the lazy dog.\",\n    markdown_style=\"none\"\n)\nprint(test.output_markdown)\n# Saída: The quick brown fox \u003cdel\u003ejumps over \u003c/del\u003e\u003cins\u003ewalks past \u003c/ins\u003ethe lazy dog.\n```\n\n**Suportado**: Python 3.10 - 3.14 (suporte para Python 3.8 e 3.9 descontinuado)\n\n**Dependências opcionais:**\n- `pip install redlines[nupunkt]` para detecção avançada de limites de sentenças (Python 3.11+, manipula abreviações, citações, URLs)\n- `pip install redlines[levenshtein]` para estatísticas adicionais\n\n## Uso\n\n### API Python\n\nA biblioteca contém uma classe: `Redlines`, que é usada para comparar texto.\n\n**Comparação básica:**\n```python\nfrom redlines import Redlines\n\ntest = Redlines(\n    \"The quick brown fox jumps over the lazy dog.\",\n    \"The quick brown fox walks past the lazy dog.\",\n    markdown_style=\"none\"\n)\nassert (\n    test.output_markdown\n    == \"The quick brown fox \u003cdel\u003ejumps over \u003c/del\u003e\u003cins\u003ewalks past \u003c/ins\u003ethe lazy dog.\"\n)\n```\n\n**Múltiplas comparações com uma fonte:**\n```python\nfrom redlines import Redlines\n\ntest = Redlines(\"The quick brown fox jumps over the lazy dog.\", markdown_style=\"none\")\nassert (\n    test.compare(\"The quick brown fox walks past the lazy dog.\")\n    == \"The quick brown fox \u003cdel\u003ejumps over \u003c/del\u003e\u003cins\u003ewalks past \u003c/ins\u003ethe lazy dog.\"\n)\n\nassert (\n    test.compare(\"The quick brown fox jumps over the dog.\")\n    == \"The quick brown fox jumps over the \u003cdel\u003elazy \u003c/del\u003edog.\"\n)\n```\n\n**Saída JSON com dados estruturados:**\n```python\nfrom redlines import Redlines\n\ntest = Redlines(\n    \"The quick brown fox jumps over the lazy dog.\",\n    \"The quick brown fox walks past the lazy dog.\"\n)\n\n# Obter JSON com mudanças, posições e estatísticas\nprint(test.output_json(pretty=True))\n```\n\n### CLI\n\n**Uso básico (saída em JSON por padrão):**\n```bash\nredlines \"old text\" \"new text\"\nredlines file1.txt file2.txt --pretty\n```\n\n**Formatos de saída:**\n```bash\nredlines text \"source\" \"test\"              # Exibição rich em terminal\nredlines markdown file1.txt file2.txt      # Saída em Markdown\nredlines stats old.txt new.txt             # Apenas estatísticas\n```\n\nExecute `redlines --help` ou `redlines guide` para [Guia de Interação para Agentes](AGENT_GUIDE.md). Veja também: [redlines-textual](https://github.com/houfu/redlines-textual).\n\n## Recursos Avançados\n\n### Processadores Personalizados\n\nUse `NupunktProcessor` para tokenização em nível de sentença com detecção inteligente de limites:\n\n```python\nfrom redlines import Redlines\nfrom redlines.processor import NupunktProcessor\n\nprocessor = NupunktProcessor()\ntest = Redlines(\"Dr. Smith said hello.\", \"Dr. Smith said hi.\", processor=processor)\n```\n\n**Use NupunktProcessor para:** Documentos legais/técnicos com abreviações, URLs, citações, decimais\n**Use WholeDocumentProcessor (padrão) para:** Documentos simples, tarefas críticas em velocidade (5-6x mais rápido), granularidade em nível de parágrafo\n\nVeja [comparação de demonstração](demo/README.md) for benchmarks.\n\n### Para Agentes de IA e Automação\n\n**🤖 Usando com agentes de codificação de IA?** Veja o **[Guia de Interação para Agentes](AGENT_GUIDE.md)** para esquemas JSON, padrões de automação, tratamento de erros e [Exemplos executáveis](examples/).\n\n## Documentação e Recursos\n\n**Documentação Completa:** [https://houfu.github.io/redlines](https://houfu.github.io/redlines)\n\n**Exemplos de Casos de Uso:**\n* Visualizar e marcar mudanças em legislação: [PLUS Explorer](https://houfu-plus-explorer.streamlit.app/)\n* Visualizar mudanças após o ChatGPT transformar um texto: [ChatGPT Prompt Engineering for Developers](https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/)Lição 6\n\n## Licença\n\nLicença MIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoufu%2Fredlines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoufu%2Fredlines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoufu%2Fredlines/lists"}