Metadata-Version: 2.4
Name: csc-essentials
Version: 1.2.1
Summary: Biblioteca de utilitários essenciais para projetos CSC
Author-email: David Braga <david.braga@stone.com.br>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: slack-sdk>=3.0.0
Requires-Dist: google-cloud-secret-manager>=2.0.0
Requires-Dist: google-cloud-compute>=1.15.0
Requires-Dist: google-cloud-storage>=2.10.0
Requires-Dist: google-cloud-bigquery>=3.10.0
Requires-Dist: google-cloud-logging>=3.5.0
Requires-Dist: google-api-core>=2.11.0
Requires-Dist: pytz>=2023.3
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: unidecode>=1.3.6
Requires-Dist: pandas>=2.0.0
Requires-Dist: openpyxl>=3.1.0
Requires-Dist: xlrd>=2.0.0
Requires-Dist: lxml>=4.9.0
Requires-Dist: protobuf>=5.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: isort>=5.0.0; extra == "dev"
Requires-Dist: black>=24.0.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Dynamic: license-file


# csc-essentials

Pequeno utilitário para integração com Google Cloud (BigQuery, Secret Manager, Cloud Logging, Compute).

## Instalação

```bash
pip install csc-essentials
```

## Quickstart (exemplo rápido)

```python
from google.cloud import bigquery
from csc_essentials.logging import GeradorLog
from csc_essentials.secrets import get_secrets
from csc_essentials.database import inserir_banco_dados

log = GeradorLog("exemplo")
# Ler segredo do Secret Manager (ex.: token Slack)
raw = get_secrets("projects/MEU_PROJ/secrets/SLACK_SECRET/versions/latest")

# Preparar cliente BigQuery
client = bigquery.Client()

# Carregar arquivo NDJSON para uma tabela
inserir_banco_dados(
    arquivo_path="/tmp/dados.ndjson",
    projeto="meu-projeto",
    dataset="meu_dataset",
    tabela="minha_tabela",
    log=log,
    client=client,
    wait_job=True,
)

print("Upload iniciado")
```

## Documentação

- Documentação por módulo em `docs/` (veja `docs/overview.md`).
- Principais módulos: `logging`, `secrets`, `utils`, `database`, `oracle`.

## Contribuindo

- Abra uma issue descrevendo o problema ou feature.
- Envie um Pull Request com testes e descrição clara das mudanças.
- Formato de código: siga o estilo existing do projeto e execute os testes (`pytest`).

## Licença

Este repositório está licenciado conforme o arquivo `LICENSE` na raiz.

## Notas rápidas

- Verifique permissões GCP ao usar `bigquery.Client()` e `secretmanager.SecretManagerServiceClient`.
- Em desenvolvimento local, você pode desativar o envio para Cloud Logging configurando `GCP_LOGGING_ATIVO=false`.
