Add your description here
Project description
🧰 nuvemshop-client-python
Cliente Python simples e direto para a API da Nuvemshop.
Feito para ser usado em integrações, scripts ou SDKs com foco em organização, reuso e fácil manutenção.
🚀 Funcionalidades
- ✅ Cliente HTTP com tratamento de erros e autenticação
- ✅ Recursos separados por módulo (
Products,Orders,Customers) - ✅ Factory embutida no client (
client.products.list(), etc) - ✅ Base genérica para criar novos recursos rapidamente
- ✅ Projeto modular com suporte a instalação via pip (
pip install -e .)
📦 Instalação
git clone https://github.com/Brunohvg/nuvemshop-client-python.git
cd nuvemshop-client-python
pip install -e src
🔧 Como usar
from nuvemshop_client import NuvemshopClient
client = NuvemshopClient("seu_store_id", "seu_token")
# Produtos
produtos = client.products.list()
produto = client.products.get(123)
client.products.create({"name": "Produto X"})
# Pedidos
pedidos = client.orders.list()
# Clientes
cliente = client.customers.get(456)
🧠 Organização do Código
src/nuvemshop_client/
├── client.py # Classe principal que gerencia a autenticação e rotas
├── exception.py # Erros customizados para tratar falhas de API
├── resources/
│ ├── base.py # Classe base para todos os recursos
│ ├── products.py # Métodos da API relacionados a produtos
│ ├── orders.py # Métodos da API relacionados a pedidos
│ └── customers.py # Métodos da API relacionados a clientes
📚 Recursos suportados
Produtos (client.products)
.list(page=1, limit=50).get(product_id).create(data).update(product_id, data).delete(product_id)
Pedidos (client.orders)
.list(page=1, limit=50).get(order_id)
Clientes (client.customers)
.list(page=1, limit=50).get(customer_id)
❗ Tratamento de erros
O client pode lançar essas exceções:
NuvemshopClientError: erro genérico da APINuvemshopClientAuthenticationError: token inválido ou expiradoNuvemshopClientNotFoundError: recurso não encontrado
Use try/except para capturar e tratar esses erros.
💡 Como criar novos recursos
Basta herdar de BaseResource e usar self.client.get/post/put/delete(...).
Exemplo:
from .base import BaseResource
class MyResource(BaseResource):
def list(self):
return self.client.get("my-resource")
📜 Licença
MIT - Livre para usar, copiar, clonar, melhorar, quebrar e reconstruir.
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 nuvemshop_client_python-0.1.1.tar.gz.
File metadata
- Download URL: nuvemshop_client_python-0.1.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c94f8f67799532c8f1cd6f9574ed8cc69399dedb4587466a811c9cc86075ef0d
|
|
| MD5 |
61789812b8de6a51518f4f3a8e5a2ff4
|
|
| BLAKE2b-256 |
fbf15a1978e8caac64a2117ff53d6ab01cb7ba2f29373f09df792251b1ea1e0f
|
File details
Details for the file nuvemshop_client_python-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nuvemshop_client_python-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
856889691a8d1bc7fb6cc53040e775e1654e24c99a353d2ea3a2b405ca9f7dd5
|
|
| MD5 |
742ecd87871486341cdc5d3689ac88bc
|
|
| BLAKE2b-256 |
da83bcc6d2d6fae1a3e85a75f6113a084325d7c2630d73b61fae1afb13235c7e
|