PGL Utils
A comprehensive library for Machine Learning, Deep Learning, and Generative AI utilities, designed for PUC and IBMEC post-graduation students.
Features
- Machine Learning (ML): Preprocessing, models, and utilities for classical ML
- Deep Learning: Architectures, training utilities, and pre-trained models
- Generative AI (GenAI): LLM utilities, RAG implementations, and prompt engineering tools
- Institution-specific extensions: Customized tools for PUC and IBMEC students
Installation
Basic Installation
pip install pgl-utils
Installation with specific features
# Machine Learning only
pip install pgl-utils[ml]
# Deep Learning only
pip install pgl-utils[deep_learning]
# Generative AI only
pip install pgl-utils[genai]
# All features
pip install pgl-utils[all]
# Development
pip install pgl-utils[dev]
Installation from source
git clone https://github.com/renansantosmendes/pgl_utils.git
cd pgl_utils
pip install -e .
Quick Start
Using Core Utilities
from pgl_utils import core
# Your code here
Using Machine Learning Tools
from pgl_utils.ml import preprocessing, models
# Your code here
Using Deep Learning Tools
from pgl_utils.deep_learning import draw_neural_network
# Your code here
Curated Stock Ticker Lists
pgl_utils.deep_learning ships curated lists of B3 (Brazil) and US stock tickers, grouped by
sector, for use in time series / financial deep learning examples. They are bundled as JSON
resources and loaded via load_brazil_tickers() / load_us_tickers(), so they work both in a
dev checkout and after installing the package with pip.
from pgl_utils.deep_learning import load_brazil_tickers, load_us_tickers
brazil_tickers = load_brazil_tickers()
us_tickers = load_us_tickers()
# Each function returns a dict keyed by sector (snake_case), mapping to a list of tickers
brazil_tickers["bancos_servicos_financeiros"]
# ["ITUB4.SA", "ITUB3.SA", "BBDC4.SA", ...]
us_tickers["tecnologia"]
# ["AAPL", "MSFT", "GOOGL", ...]
The underlying JSON files live at pgl_utils/deep_learning/data/brazil_tickers.json and
pgl_utils/deep_learning/data/us_tickers.json.
Using Generative AI Tools
from pgl_utils.genai import llm, rag
# Your code here
Using the PGL Search Gateway
from pgl_utils.genai.search_gateway import PGLSearchGateway
gateway = PGLSearchGateway()
results = gateway.search(
"inteligência artificial generativa",
search_depth="advanced",
include_raw_content=True,
)
Institution-Specific Tools
For PUC Students
from pgl_utils.puc import config
puc_info = config.PUCConfig.get_info()
For IBMEC Students
from pgl_utils.ibmec import config
ibmec_info = config.IBMECConfig.get_info()
Project Structure
pgl_utils/
├── pgl_utils/ # Main package
│ ├── __init__.py
│ ├── core/ # Shared utilities
│ │ ├── __init__.py
│ │ └── utils.py
│ ├── ml/ # Machine Learning module
│ │ ├── __init__.py
│ │ ├── preprocessing.py
│ │ └── models.py
│ ├── deep_learning/ # Deep Learning module
│ │ ├── __init__.py
│ │ ├── architectures.py
│ │ ├── training.py
│ │ ├── tickers.py # Brazil/US ticker loaders
│ │ └── data/ # brazil_tickers.json, us_tickers.json
│ ├── genai/ # Generative AI module
│ │ ├── __init__.py
│ │ ├── llm.py
│ │ ├── rag.py
│ │ └── search_gateway.py
│ ├── puc/ # PUC-specific extensions
│ │ ├── __init__.py
│ │ └── config.py
│ └── ibmec/ # IBMEC-specific extensions
│ ├── __init__.py
│ └── config.py
├── tests/ # Unit tests
├── examples/ # Example notebooks and scripts
├── docs/ # Documentation
├── setup.py # Package configuration
├── requirements.txt # Dependencies
├── README.md # This file
└── .gitignore # Git ignore rules
Requirements
- Python >= 3.8
- numpy >= 1.21.0
- pandas >= 1.3.0
- scikit-learn >= 1.0.0
Dependencies by Module
Machine Learning (ML)
- scikit-learn
- xgboost
- lightgbm
Deep Learning
- torch
- tensorflow
- keras
Generative AI (GenAI)
- openai
- langchain
- huggingface-hub
Examples
See the examples/ directory for jupyter notebooks and scripts demonstrating library usage.
Testing
Run tests with pytest:
pytest tests/
With coverage:
pytest tests/ --cov=pgl_utils
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues, questions, or suggestions, please open an issue on GitHub.
Changelog
Version 0.1.0
- Initial release
- Core functionality for ML, Deep Learning, and GenAI
- Institution-specific extensions for PUC and IBMEC
Metadata
Release files for pgl-utils 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pgl_utils-0.7.0.tar.gz | 600.7 kB | Without provenance | Details for pgl_utils-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pgl_utils-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for pgl_utils-0.7.0-py3-none-any.whl |
Total release size: 701.6 kB
Release files / pgl_utils-0.7.0.tar.gz
| Download URL | pgl_utils-0.7.0.tar.gz |
|---|---|
| Size | 600.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
983a4515a22fa84a04bdc5f474b59bfafd9f2babcfb3a0c8ec3ba1535025eae5
|
|
BLAKE2b-256 checksum How to use checksums |
e273151af3c8f201ebcfe5fbf61550f7ed64f7a110f6ae74a49d88c10395a725
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pgl_utils-0.7.0-py3-none-any.whl
| Download URL | pgl_utils-0.7.0-py3-none-any.whl |
|---|---|
| Size | 100.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed31610babf1d8d71cd64cf9caf3dce2ffc7b1827b8f2348ec69f6d530f7f35f
|
|
BLAKE2b-256 checksum How to use checksums |
32d16f98e3857047f973e96028e9578e198010b73fc96367eab618d923e91c12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for pgl-utils 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.