Configura automaticamente o AgGrid no Streamlit com base em um DataFrame
Project description
make-aggrid
make-aggrid é uma biblioteca Python que facilita a configuração avançada do componente AgGrid para uso com Streamlit. Basta passar um DataFrame e ela automaticamente aplica filtros, formatações e estilos adequados com base nos tipos de dados.
Instalação
pip install make-aggrid
Uso Básico
import pandas as pd
import streamlit as st
from st_aggrid import AgGrid
from make_aggrid import make_grid
df = pd.read_csv("dados.csv")
grid_options = make_grid(df)
AgGrid(df, gridOptions=grid_options)
Recursos incluídos
- Filtros automáticos para texto, número e datas
- Formatação brasileira para números e datas (
pt-BR) - Alinhamento de colunas conforme tipo
- Edição inline
- Paginação e animações
Exemplo Avançado com Streamlit
import streamlit as st
import pandas as pd
from st_aggrid import AgGrid
from make_aggrid import make_grid
data = {
"Nome": ["Ana", "João", "Carlos"],
"Idade": [23, 35, 29],
"Salário": [3000.50, 5000.00, 4200.75],
"Data de Admissão": pd.to_datetime(["2020-01-15", "2019-03-10", "2021-07-22"])
}
df = pd.DataFrame(data)
st.title("Tabela Interativa com AgGrid")
grid_options = make_grid(df)
AgGrid(df, gridOptions=grid_options, editable=True, fit_columns_on_grid_load=True)
Licença
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file make_aggrid-0.1.2.tar.gz.
File metadata
- Download URL: make_aggrid-0.1.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.12.6 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25d8871aef3f2c0a274e026d7181f2f763ff0135ab8c302f127d4be74a3f4834
|
|
| MD5 |
abec3bce66c88ecc238dbb154fd2ac3f
|
|
| BLAKE2b-256 |
0a32f1a8735caa41f436288b439f9b24a91c612173477ccd9ee5921bcf7a213f
|
File details
Details for the file make_aggrid-0.1.2-py3-none-any.whl.
File metadata
- Download URL: make_aggrid-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.12.6 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b25a801e45ad66e8c87036ed624d1ce2e080fe47d6857e723db53a277e149604
|
|
| MD5 |
98ab04d5a714404a85725335ee4dba91
|
|
| BLAKE2b-256 |
373f0fa31d607c5105d00d555fc33ad354e1e84bf5ae09eba4f609df2a4b97f0
|