No project description provided
Project description
gsheets3
Conecte seu projeto Django ao Google Sheets de forma simples e eficiente.
gsheets3 é um pacote Python que permite sincronizar modelos Django com planilhas do Google Sheets.
Ideal para quem precisa armazenar ou visualizar dados em tempo real diretamente no Google Sheets, sem complicações.
🔧 Instalação
pip install gsheets3
🚀 Como Usar
1. Crie seu modelo com o mixin SheetSyncableMixin:
from django.db import models
from django.conf import settings
from gsheets3 import mixins
class Exemplo(mixins.SheetSyncableMixin, models.Model):
spreadsheet_id = settings.GSHEETS.get("KEY")
sheet_name = 'nome do worksheet'
data_range = 'A1:Z'
model_id_field = 'id'
sheet_id_field = 'Django GUID'
batch_size = 500
max_rows = 300
max_col = 'Z'
Nome = models.CharField(max_length=255)
Tom = models.CharField(max_length=50)
def __str__(self):
return self.Nome
2. Inclua a URL no urls.py (do projeto principal):
from django.urls import path, include
urlpatterns = [
path('', include('gsheets3.urls')),
]
3. Configure as credenciais no settings.py:
SPERADSHEET_ID = getenv("KEY")
GSHEETS = {
"service": {
"private_key": getenv("PRIVATE_KEY"),
"client_email": getenv("CLIENT_EMAIL"),
"token_uri": getenv("TOKEN_URI"),
}
}
4. Primeira utilização
Acesse a rota:
/gsheets/cliente/
📦 Pré-requisitos
🔗 Links Úteis
Desenvolvido para facilitar a integração de dados entre seu backend Django e as planilhas do Google! Este pacote foi criado a partir do django-sheets https://pypi.org/project/django-gsheets/
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
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 gsheets3-0.1.1.tar.gz.
File metadata
- Download URL: gsheets3-0.1.1.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
533ec5f7f6414948d081f8bee29b447b6425921902e0ddc45f203c906245d6ea
|
|
| MD5 |
049a491af5b38c0cbd3d5b44b5a712f9
|
|
| BLAKE2b-256 |
f913365d968358eec97b3ad451a8d9ca58457c9903658557af1d00f44f75f32e
|
File details
Details for the file gsheets3-0.1.1-py3-none-any.whl.
File metadata
- Download URL: gsheets3-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
337f06a86a5f21dec707eb0f0b161a0f8e7699a9bd583afb6feb73a9d012199e
|
|
| MD5 |
935c40979ebc91a65d515c14aa067f53
|
|
| BLAKE2b-256 |
d961fb1f4fc7ae89a72f6df3a155b6ece09271626996aadacf89ddbbbca8616c
|