Metadata-Version: 2.4
Name: nexus-hostinger
Version: 1.0.0
Summary: SDK Oficial em Python para automação e integração com a API da NEXUS HOSTINGER
Author-email: NEXUS HOSTINGER <suporte@nexushost.cloud>
Project-URL: Homepage, https://nexushost.cloud
Project-URL: Documentation, https://nexushost.cloud/docs
Project-URL: Discord, https://discord.gg/9F99uS7UWe
Keywords: nexus,discord,hosting,cloud,bots,sdk
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Requires-Dist: urllib3>=1.26.0
Provides-Extra: async
Requires-Dist: httpx>=0.24.0; extra == "async"

# ⚡ NEXUS HOSTINGER — Python SDK

SDK Oficial em Python para automação, monitoramento e gerenciamento de aplicações na plataforma [NEXUS HOSTINGER](https://nexushost.cloud).

---

## 📦 Instalação

```bash
pip install nexus-hostinger
```

---

## 🚀 Como Usar

### 1. Inicializando o Cliente

Gere sua Chave de API no painel em **Desenvolvedor > Chaves de API**:

```python
from nexus_hosting import NexusClient

nexus = NexusClient(api_key="nexus_live_sua_chave_aqui")
```

---

### 2. Exemplos Práticos

#### 📊 Consultar Recursos do Workspace
```python
resources = nexus.account.get_resources()
print(resources["data"]["resources"])
```

#### 🤖 Gerenciar Bots
```python
# Listar todos os bots
bots = nexus.bots.list()
for bot in bots:
    print(f"[{bot['status']}] {bot['name']} (ID: {bot['id']})")

# Iniciar, desligar ou reiniciar
nexus.bots.restart("id-do-bot")

# Inspecionar estatísticas em tempo real
stats = nexus.bots.stats("id-do-bot")
print(f"Uso de RAM: {stats.get('memoryUsageMb', 0)}MB")

# Consultar logs do console
logs = nexus.bots.logs("id-do-bot", lines=50)
for line in logs:
    print(line)
```

#### ⚡ Execução de Comandos Shell no Contêiner
```python
res = nexus.bots.exec("id-do-bot", "pip list")
print(res["output"])
```

#### 📁 Manipulação de Arquivos (REST Files API)
```python
# Listar arquivos
files = nexus.bots.files.list("id-do-bot")

# Ler arquivo
config = nexus.bots.files.read("id-do-bot", "config.json")
print(config["content"])

# Salvar ou atualizar arquivo
nexus.bots.files.save("id-do-bot", "config.json", '{"prefix": "!"}')
```

---

## 🛡️ Tratamento de Erros

```python
from nexus_hosting import NexusClient, NexusAuthError, NexusRateLimitError, NexusApiError

try:
    nexus = NexusClient(api_key="chave_invalida")
    bots = nexus.bots.list()
except NexusAuthError:
    print("Chave de API inválida ou expirada!")
except NexusRateLimitError:
    print("Limite de requisições por minuto atingido. Aguarde alguns instantes.")
except NexusApiError as e:
    print(f"Erro na API NEXUS: {e}")
```

---

## 🌐 Links Oficiais
* **Painel:** https://nexushost.cloud
* **Documentação:** https://nexushost.cloud/docs
* **Comunidade Discord:** https://discord.gg/9F99uS7UWe
