Skip to main content

Biblioteca Python com ferramentas essenciais para desenvolvimento de RPA e ML, oferecendo recursos para conexão com bancos de dados, logging e utilitários.

Project description

Personallize

Uma biblioteca Python com ferramentas essenciais para desenvolvimento de RPA (Robotic Process Automation) e ML (Machine Learning), oferecendo recursos para conexão com bancos de dados, logging e utilitários.

✨ Funcionalidades

  • 🔌 Dialetic: Conexões SQLAlchemy para SQLite, MySQL, PostgreSQL e SQL Server
  • 📊 Logging: Sistema de logging simples e avançado
  • 🌐 BrowserService (extra opcional): Captura de cookies/token via Playwright e montagem de requests.Session

📋 Requisitos

  • Python >= 3.11

📦 Instalação

Com uv (recomendado)

uv add personallize

Com pip

pip install personallize

Para desenvolvimento

uv pip install -e ".[dev]"

🚀 Uso

🔌 Conexão com Banco de Dados

from sqlalchemy import text

from personallize.dialetic.sqlite import SqliteConnection

# SQLite (arquivo; se não passar path, cria por padrão em ./data/<nome_da_pasta>.db)
with SqliteConnection("data/app.db") as db:
    db.session.execute(text("SELECT 1"))

# Acessar engine diretamente
engine = SqliteConnection("data/app.db").get_engine()

📊 Sistema de Logging

from personallize.loggers import ConsoleFormats, FileFormats, LogManager, RetentionOptions

manager = LogManager()

manager.config.console({
    "icon_status": "active",
    "show_debug": True,
    "format": ConsoleFormats.MEDIUM,
    "enqueue": True,
})

manager.config.file({
    "log_file": "logs/my_app",
    "format": FileFormats.FULL,
    "retention": RetentionOptions.ONE_WEEK,
    "rotation": "00:00",
    "enqueue": True,
})

log = manager.get_logger()
log.info("Aplicação iniciada")
log.error("Erro encontrado")

🌐 BrowserService (extra opcional)

Instale com o extra browser:

uv add "personallize[browser]"
from personallize.browser_service import BrowserService

with BrowserService(base_url="https://seu-sistema.com", headless=True) as bs:
    bs.goto("https://seu-sistema.com/login")
    snap = bs.snapshot_auth()
    session = bs.build_requests_session(cookie_domain_filter="seu-sistema.com")

🔧 Desenvolvimento

Executando testes

uv run pytest

Linting

uv run ruff check .

📦 Publicação (PyPI) com uv

uv build
uv publish dist/*

📄 Licença

Este projeto está licenciado sob a Licença MIT - veja o arquivo LICENSE para detalhes.

👨‍💻 Autor

Miguel Tenório

🤝 Contribuindo

Contribuições são bem-vindas! Por favor, sinta-se à vontade para submeter um Pull Request.

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

personallize-1.3.2.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

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

personallize-1.3.2-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file personallize-1.3.2.tar.gz.

File metadata

  • Download URL: personallize-1.3.2.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.23

File hashes

Hashes for personallize-1.3.2.tar.gz
Algorithm Hash digest
SHA256 b8f93e552d6cb74f80929debf16631a1bc45d3075140ba6cbf7c33659c4d4f3c
MD5 1a38ad732473ba02255b8b5f46596a5a
BLAKE2b-256 b9dbcf18c7a2546d7e637909835fdff97ea3516d7a5e5edc52bb94859e1632a9

See more details on using hashes here.

File details

Details for the file personallize-1.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for personallize-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fda20a96e421cccc4a9b9813a0d8fccdff0048b6d4f9e9a0af226ef411d0d9c8
MD5 dd95dbdccddaf6665bce8ccf6e686396
BLAKE2b-256 06d5eb803f9aebe1feb81f5ca41fd3f2cec9240807dedc5a9181c3f47cceda0d

See more details on using hashes here.

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