{"id":37605710,"url":"https://github.com/robertolima-dev/text-cleaner-for-py","last_synced_at":"2026-01-20T16:37:21.757Z","repository":{"id":279234304,"uuid":"938156379","full_name":"robertolima-dev/text-cleaner-for-py","owner":"robertolima-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-12T22:12:19.000Z","size":65,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-25T01:27:24.958Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertolima-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-02-24T14:08:05.000Z","updated_at":"2025-08-12T22:12:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"df84c99b-9058-49b3-8a92-5c435e3ed525","html_url":"https://github.com/robertolima-dev/text-cleaner-for-py","commit_stats":null,"previous_names":["robertolima-dev/text-cleaner-for-py"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robertolima-dev/text-cleaner-for-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertolima-dev%2Ftext-cleaner-for-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertolima-dev%2Ftext-cleaner-for-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertolima-dev%2Ftext-cleaner-for-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertolima-dev%2Ftext-cleaner-for-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertolima-dev","download_url":"https://codeload.github.com/robertolima-dev/text-cleaner-for-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertolima-dev%2Ftext-cleaner-for-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: 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":[],"created_at":"2026-01-16T10:08:55.833Z","updated_at":"2026-01-16T10:08:56.654Z","avatar_url":"https://github.com/robertolima-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚 **/text-cleaner-for-py**\n\n🧹 **/text-cleaner-for-py** é um pacote Python leve e eficiente para **limpeza** e **normalização de text**. Ele oferece recursos para remoção de HTML, acentos, caracteres especiais, além de filtros, normalização e remoção de stopwords.\n\n---\n\n## ✨ **Funcionalidades**\n- 🔡 **Normalização de text:**\n  - Conversão para minúsculas.\n  - Remoção de acentos e caracteres especiais.\n- 🧹 **Limpeza avançada:**\n  - Remoção de HTML e tags indesejadas.\n  - Redução de múltiplos espaços e quebras de linha.\n- 🔍 **Filtros de text:**\n  - Manutenção de letras e números.\n  - Remoção de stopwords com suporte a múltiplos idiomas.\n- 🚀 **Funcionalidades Avançadas:**\n  - Detecção automática de idioma\n  - Remoção de emojis e emoticons\n  - Remoção de URLs e emails\n  - Normalização de números, datas e valores monetários\n  - Correção de erros comuns de digitação\n  - Remoção de texto duplicado\n  - Normalização de abreviações\n  - Stemming e lematização\n\n---\n\n## ⚡ **Instalação**\n\nInstale o pacote diretamente do PyPI:\n\n```bash\npip install text_cleaner_for_py\n```\n\n\u003e O pacote depende de `nltk`, `beautifulsoup4`, `emoji` e `langdetect`.\n\n---\n\n## 💡 **Como Usar**\n\n### 🧹 **Uso Básico:**\n```python\nfrom text_cleaner_for_py.cleaner import clean_text\n\ntext = \"Olá, mundo! Bem-vindo ao Text Cleaner 🧹✨\"\nprint(clean_text(text))  # Saída: ola mundo bem vindo ao text cleaner\n```\n\n### 🚀 **Uso Avançado:**\n```python\nfrom text_cleaner_for_py.advanced_cleaner import AdvancedTextCleaner\n\ncleaner = AdvancedTextCleaner()\n\n# Limpeza completa com opções padrão\ntext = \"Olá! 👋 Visite https://exemplo.com ou envie email para teste@exemplo.com. Data: 25/12/2023. Preço: R$ 1.234,56. vc sabe pq?\"\ncleaned = cleaner.clean_advanced(text)\nprint(cleaned)\n\n# Limpeza personalizada\noptions = {\n    'remove_emojis': True,\n    'remove_urls': False,\n    'normalize_dates': True,\n    'remove_typos': True\n}\ncleaned = cleaner.clean_advanced(text, options)\nprint(cleaned)\n```\n\n### 🔡 **Normalização de text:**\n```python\nfrom text_cleaner_for_py.cleaner_v1 import normalize_text\n\ntext = \"\u003cp\u003eOlá, Mundo!\u003c/p\u003e Bem-vindo ao /text-cleaner-for-py! 🧹✨\"\ntexto_normalizado = normalize_text(text)\n\nprint(texto_normalizado)  # Saída: ola mundo bem vindo ao text cleaner for py\n```\n\n### 🌐 **Removendo HTML:**\n```python\nfrom text_cleaner_for_py.cleaner_v1 import remove_html_tags\n\nhtml_text = \"\u003cdiv\u003e\u003cp\u003eTexto \u003cb\u003eimportante\u003c/b\u003e\u003c/p\u003e\u003c/div\u003e\"\nprint(remove_html_tags(html_text))  # Saída: Texto importante\n```\n\n### 🧹 **Reduzindo espaços:**\n```python\nfrom text_cleaner_for_py.cleaner_v1 import clean_whitespace\n\ntext = \"Texto   com   espaços    e  \\n\\n quebras.\"\nprint(clean_whitespace(text))  # Saída: Texto com espaços e quebras.\n```\n\n### 🔠 **Filtrando letras e números:**\n```python\nfrom text_cleaner_for_py.cleaner_v1 import filter_letters, filter_numbers\n\ntext = \"Telefone: 123-456-789\"\nprint(filter_letters(text))  # Saída: Telefone\nprint(filter_numbers(text))  # Saída: 123456789\n```\n\n### 📝 **Removendo stopwords:**\n```python\nfrom text_cleaner_for_py.cleaner_v1 import remove_stopwords\n\ntext = \"Este é um text simples para teste de stopwords.\"\nprint(remove_stopwords(text, language='portuguese'))  # Saída: text simples teste stopwords.\n```\n\n### 🚀 **Funcionalidades Avançadas:**\n```python\nfrom text_cleaner_for_py.advanced_cleaner import AdvancedTextCleaner\n\ncleaner = AdvancedTextCleaner()\n\n# Detecção de idioma\nprint(cleaner.detect_language(\"Olá, como vai você?\"))  # Saída: pt\n\n# Remoção de emojis\ntext = \"Olá! 👋 Como vai você? 😊\"\nprint(cleaner.remove_emojis(text))  # Saída: Olá!  Como vai você? \n\n# Normalização de números\ntext = \"1º lugar, 2º lugar, 3º lugar\"\nprint(cleaner.normalize_numbers(text))  # Saída: primeiro lugar, segundo lugar, terceiro lugar\n\n# Normalização de datas\ntext = \"Data: 25/12/2023\"\nprint(cleaner.normalize_dates(text))  # Saída: Data: 25 de dezembro de 2023\n\n# Correção de erros comuns\ntext = \"vc sabe pq isso aconteceu?\"\nprint(cleaner.remove_typos(text))  # Saída: você sabe porque isso aconteceu?\n\n# Stemming e lematização\ntext = \"correndo pulando saltando\"\nprint(cleaner.stem_text(text))  # Saída: corr pul salt\nprint(cleaner.lemmatize_text(text))  # Saída: correr pular saltar\n```\n\n---\n\n## 🚀 **Casos de Uso**\n\n### 📊 **Processamento de Grandes Volumes de Texto**\n\n```python\nfrom text_cleaner_for_py.performance_cleaner import PerformanceTextCleaner\n\n# Inicializa o limpeza com performance otimizada\ncleaner = PerformanceTextCleaner()\n\n# Processa múltiplos textos em paralelo\ntexts = [\n    \"Olá, mundo! 🧹✨\",\n    \"Bem-vindo ao Text Cleaner!\",\n    \"Teste de performance\"\n]\ncleaned_texts = cleaner.clean_texts_parallel(texts)\nprint(cleaned_texts)  # ['ola mundo', 'bem vindo ao text cleaner', 'teste de performance']\n\n# Processa um texto grande dividindo em chunks\nlarge_text = \"Olá, mundo! \" * 1000\ncleaned_large_text = cleaner.clean_large_text(large_text, chunk_size=1000)\nprint(len(cleaned_large_text))  # Tamanho do texto limpo\n```\n\n### 🔄 **Cache para Textos Frequentes**\n\n```python\nfrom text_cleaner_for_py.performance_cleaner import PerformanceTextCleaner\n\ncleaner = PerformanceTextCleaner()\n\n# O mesmo texto será processado apenas uma vez\ntext = \"Olá, mundo! 🧹✨\"\nresult1 = cleaner.clean_text_cached(text)  # Processa o texto\nresult2 = cleaner.clean_text_cached(text)  # Usa o cache\nassert result1 == result2  # True\n```\n\n### ⚙️ **Limpeza com Opções Específicas**\n\n```python\nfrom text_cleaner_for_py.performance_cleaner import PerformanceTextCleaner\n\ncleaner = PerformanceTextCleaner()\n\n# Limpeza com opções específicas\ntext = \"Olá! 👋 Visite https://exemplo.com\"\noptions = {\n    'remove_emojis': True,\n    'remove_urls': True\n}\ncleaned_text = cleaner.clean_text_with_options(text, options)\nprint(cleaned_text)  # 'ola visite'\n```\n\n### 📈 **Benchmark de Performance**\n\n```python\nimport time\nfrom text_cleaner_for_py.performance_cleaner import PerformanceTextCleaner\n\ncleaner = PerformanceTextCleaner()\n\n# Teste de performance com texto grande\nlarge_text = \"Olá, mundo! \" * 10000\n\n# Tempo sem processamento paralelo\nstart_time = time.time()\nresult1 = cleaner.clean_text_cached(large_text)\nend_time = time.time()\nprint(f\"Tempo sem paralelismo: {end_time - start_time:.2f} segundos\")\n\n# Tempo com processamento paralelo\nstart_time = time.time()\nresult2 = cleaner.clean_large_text(large_text)\nend_time = time.time()\nprint(f\"Tempo com paralelismo: {end_time - start_time:.2f} segundos\")\n```\n\n### 🔧 **Configuração Avançada**\n\n```python\nfrom text_cleaner_for_py.performance_cleaner import PerformanceTextCleaner\n\n# Configura o número de workers para processamento paralelo\ncleaner = PerformanceTextCleaner(max_workers=4)\n\n# Processa textos com configuração personalizada\ntexts = [\"Texto 1\", \"Texto 2\", \"Texto 3\"]\ncleaned_texts = cleaner.clean_texts_parallel(texts)\n```\n\n## 🚀 Casos de Uso Avançados e Performance\n\n### 🧵 Processamento Paralelo de Textos\n```python\nfrom text_cleaner_for_py.performance_cleaner import PerformanceTextCleaner\ncleaner = PerformanceTextCleaner()\ntexts = [\n    \"Olá, mundo! 🧹✨\",\n    \"Bem-vindo ao Text Cleaner!\",\n    \"Teste de performance\"\n]\ncleaned = cleaner.clean_texts_parallel(texts)\nprint(cleaned)\n```\n\n### 🧩 Processamento de Texto Grande em Chunks\n```python\nlarge_text = \"Olá, mundo! \" * 1000\ncleaned_large = cleaner.clean_large_text(large_text, chunk_size=1000)\nprint(len(cleaned_large))\n```\n\n### 🧠 Cache Local de Limpeza\n```python\ntext = \"Olá, mundo! 🧹✨\"\nresult1 = cleaner.clean_text_cached(text)\nresult2 = cleaner.clean_text_cached(text)\nassert result1 == result2\n```\n\n### 🧬 Remoção de Ruído de OCR\n```python\ntext = \"H3ll0 W0rld! Th1s 1s 4 t3st.\"\nprint(cleaner.remove_ocr_noise(text))  # Saída: Hello World! This is a test.\n```\n\n### ⚖️ Normalização de Unidades de Medida\n```python\ntext = \"O produto pesa 1.5kg e mede 2.5m\"\nprint(cleaner.normalize_measurements(text))  # Saída: O produto pesa 1.5 quilogramas e mede 2.5 metros\n```\n\n### 🔁 Remoção de Conteúdo Duplicado\n```python\ntext = \"Olá mundo! Olá mundo! Como vai você?\"\nprint(cleaner.remove_duplicates(text))  # Saída: Olá mundo! Como vai você?\n```\n\n### 🏷️ Normalização de Nomes Próprios\n```python\ntext = \"joão da silva e maria santos\"\nprint(cleaner.normalize_proper_names(text))  # Saída: João da Silva e Maria Santos\n```\n\n### ⚙️ Limpeza com Opções Específicas\n```python\ntext = \"Olá! 👋 Visite https://exemplo.com\"\noptions = {'remove_emojis': True, 'remove_urls': True}\nprint(cleaner.clean_text_with_options(text, options))  # Saída: ola visite\n```\n\n### Correção Ortográfica\n```python\nfrom text_cleaner_for_py.spell_checker import SpellCheckerCleaner\n\nspell_checker = SpellCheckerCleaner(language='pt')\ntexto = \"Olá mundu! Como vai vc?\"\n\n# Verificar erros ortográficos\nerros = spell_checker.check_text(texto)\nprint(erros)  # {'mundu': [...], 'vc': ['você']}\n\n# Corrigir texto automaticamente\ncorrigido = spell_checker.correct_text(texto)\nprint(corrigido)  # Olá mundo! Como vai você?\n\n# Sugestões para uma palavra\nsugestoes = spell_checker.get_suggestions('mundu')\nprint(sugestoes)  # ['mundo', ...]\n```\n\n### Processamento de Documentos\n```python\nfrom text_cleaner_for_py.document_processor import DocumentProcessor\n\nprocessor = DocumentProcessor()\n\n# Ler um arquivo TXT\nconteudo = processor.read_document('exemplo.txt')\nprint(conteudo)\n\n# Ler um arquivo PDF\n# conteudo_pdf = processor.read_document('exemplo.pdf')\n# print(conteudo_pdf)\n\n# Ler um arquivo DOCX\n# conteudo_docx = processor.read_document('exemplo.docx')\n# print(conteudo_docx)\n\n# Extrair metadados\nmetadados = processor.extract_metadata('exemplo.txt')\nprint(metadados)\n\n# Extrair tabelas de um DOCX\n# tabelas = processor.extract_tables('exemplo.docx')\n# print(tabelas)\n```\n\n---\n\n## 🧪 **Testes**\n\nExecute os testes com `pytest`:\n\n```bash\npytest tests/\n```\n\nPara execução detalhada:\n```bash\npytest -v\n```\n\n---\n\n## 🏗 **Estrutura do Projeto**\n\n```\ntext_cleaner_for_py/\n│\n├── text_cleaner_for_py/             # 📦 Código do pacote\n│   ├── __init__.py\n│   ├── cleaner_v1.py                # ⚡ Funções básicas de limpeza\n│   ├── cleaner.py                   # ⚡ Funções principais de limpeza\n│   └── advanced_cleaner.py          # 🚀 Funções avançadas de limpeza\n│\n├── tests/                           # 🧪 Testes unitários\n│   ├── test_cleaner_v1.py\n│   ├── test_cleaner.py\n│   └── test_advanced_cleaner.py\n│\n├── setup.py                         # ⚙️ Configuração do pacote para PyPI\n├── pyproject.toml                   # 📦 Configuração moderna\n├── README.md                        # 📚 Documentação do pacote\n├── LICENSE                          # 📜 Licença MIT\n└── MANIFEST.in                      # 📋 Inclusão de arquivos extras\n```\n\n---\n\n## 📝 **Licença**\n\nDistribuído sob a **Licença MIT**. Veja o arquivo [LICENSE](LICENSE) para mais informações.\n\n---\n\n## 👨‍💻 **Autor**\n\nDesenvolvido por **[Roberto Lima](https://robertolima-developer.vercel.app/)** 🚀✨\n\n---\n\n## 💬 **Contato**\n\n- 📧 **Email**: robertolima.izphera@gmail.com\n- 💼 **LinkedIn**: [Roberto Lima](https://www.linkedin.com/in/roberto-lima-01/)\n- 💼 **Website**: [Roberto Lima](https://robertolima-developer.vercel.app/)\n- 💼 **Gravatar**: [Roberto Lima](https://gravatar.com/deliciouslyautomaticf57dc92af0)\n\n---\n\n## ⭐ **Gostou do projeto?**\n\nDeixe uma ⭐ no repositório e compartilhe com a comunidade! 🚀✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertolima-dev%2Ftext-cleaner-for-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertolima-dev%2Ftext-cleaner-for-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertolima-dev%2Ftext-cleaner-for-py/lists"}