Skip to main content

Repositorio central de ativos de automacao e bibliotecas compartilhadas

Project description

loot

Repositório central de ativos de automação e bibliotecas compartilhadas.

Consolida o conhecimento técnico da equipe em um único lugar, evitando retrabalho entre projetos.

Propósito

Desafios técnicos de automação (Auth, ETL, Integrações) se repetem entre projetos. Este repositório centraliza essas soluções para:

  1. Reduzir retrabalho reutilizando código já testado
  2. Padronizar implementações recorrentes
  3. Centralizar práticas de segurança (credenciais, retries, etc)

Estrutura

O repositório organiza soluções agnósticas ao cliente/projeto:

  • /auth: Módulos de autenticação (OAuth2 flows, gestão de tokens, cookies sessions).
  • /parsers: Tratamento e normalização de dados (PDF, Excel, CSV, Strings regex).
  • /connectors: Wrappers e clientes para APIs frequentes (Google Workspace, Slack, ERPs).
  • /helpers: Utilitários de infraestrutura (Loggers, Decorators de retry, Tratamento de exceção).
  • /scaffolds: Estruturas base para iniciar novos bots ou automações.

Guia de Contribuição

Contribua com qualquer código reutilizável: funções genéricas, classes utilitárias ou scripts de configuração.

Requisitos

  1. Sanitização: Remova credenciais e dados sensíveis. Use variáveis de ambiente (os.getenv).
  2. Desacoplamento: O código deve funcionar fora do contexto original.
  3. Documentação: Adicione docstring explicando o que faz e suas dependências.
  4. Type Hints: Adicione type hints em todas as funções.

Type Hints

O pacote inclui suporte completo a type hints (py.typed). Ao adicionar código:

from typing import TypedDict

# Com type hints
def validar_email(email: str) -> bool:
    """Valida formato de email."""
    return "@" in email

# Retorno complexo com TypedDict
class ResultadoValidacao(TypedDict):
    valido: bool
    mensagem: str

def processar_dados(valor: str) -> ResultadoValidacao:
    return {"valido": True, "mensagem": "OK"}

# Evitar: sem type hints
def validar_email(email):
    return "@" in email

O arquivo py.typed já está configurado. Basta adicionar type hints (param: tipo e -> tipo_retorno) em funções novas. Use TypedDict para dicts de retorno complexos.

Instalação

Via PyPI

# Com UV
uv add qegloot

# Com pip
pip install qegloot

Via GitHub

uv pip install git+https://github.com/QualidadeGestaoBRMED/loot.git@v0.1.0
uv pip install git+https://github.com/QualidadeGestaoBRMED/loot.git

Instalação local

git clone https://github.com/QualidadeGestaoBRMED/loot.git
cd loot
uv venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"

Uso

from loot.parsers import process_document, is_cpf_valid

# Processar e validar CPF
result = process_document("123.456.789-09")
print(result)
# {'original_input': '123.456.789-09', 'type': 'CPF',
#  'is_valid': True, 'clean_value': '12345678909',
#  'formatted': '123.456.789-09'}

# Validação direta
if is_cpf_valid("12345678909"):
    print("CPF válido!")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qegloot-0.1.3.tar.gz (59.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qegloot-0.1.3-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file qegloot-0.1.3.tar.gz.

File metadata

  • Download URL: qegloot-0.1.3.tar.gz
  • Upload date:
  • Size: 59.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qegloot-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e6d73b9b6a56552ea8fbfa5ac1a4d5b3d5287d5ab44a0fbb61730a3347ce341f
MD5 d4911f9203f1aee7e73fe0f9ac7f10d2
BLAKE2b-256 0533641c35b2c1dcb57da94a7edfe0f0e4d4048e09d3ff4e9300091022dd98e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for qegloot-0.1.3.tar.gz:

Publisher: publish.yml on QualidadeGestaoBRMED/loot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qegloot-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: qegloot-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qegloot-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8102dd8ff6f315b8b1a50d966bdc1c830aaf97f136cd563b0194d04b1e5550fc
MD5 cbb2526308d30530c85580c33f3b0152
BLAKE2b-256 a18d59d77eaa72b7c542b61f50609f38792af44244a5e3adff28a4b2caf96c22

See more details on using hashes here.

Provenance

The following attestation bundles were made for qegloot-0.1.3-py3-none-any.whl:

Publisher: publish.yml on QualidadeGestaoBRMED/loot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page