Skip to main content

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 API
  • NuvemshopClientAuthenticationError: token inválido ou expirado
  • NuvemshopClientNotFoundError: 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

nuvemshop_client_python-0.1.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

nuvemshop_client_python-0.1.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

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

Hashes for nuvemshop_client_python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c94f8f67799532c8f1cd6f9574ed8cc69399dedb4587466a811c9cc86075ef0d
MD5 61789812b8de6a51518f4f3a8e5a2ff4
BLAKE2b-256 fbf15a1978e8caac64a2117ff53d6ab01cb7ba2f29373f09df792251b1ea1e0f

See more details on using hashes here.

File details

Details for the file nuvemshop_client_python-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nuvemshop_client_python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 856889691a8d1bc7fb6cc53040e775e1654e24c99a353d2ea3a2b405ca9f7dd5
MD5 742ecd87871486341cdc5d3689ac88bc
BLAKE2b-256 da83bcc6d2d6fae1a3e85a75f6113a084325d7c2630d73b61fae1afb13235c7e

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