Metadata-Version: 2.4
Name: activesoft-cli
Version: 0.1.0
Summary: CLI tool for Activesoft Siga automation
Author: Tulio Amancio
Project-URL: Homepage, https://github.com/tsuriu/activesoft-cli
Project-URL: Bug Tracker, https://github.com/tsuriu/activesoft-cli/issues
Keywords: activesoft,siga,automation,cli,sdk
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0
Requires-Dist: loguru
Requires-Dist: click

# Activesoft Siga CLI

A Python SDK and CLI tool for automating interactions with the Activesoft Siga API. This tool simplifies retrieval of student and responsible party data.

## Installation

Install via pip:

```bash
pip install activesoft-cli
```

Or from source:

```bash
git clone https://github.com/tsuriu/activesoft-cli.git
cd activesoft-cli
pip install .
```

## CLI Usage

The package includes a command-line interface `activesoft-cli` with two main commands: `run` and `responsaveis`.

### Student Management (`run`)

Lists students or retrieves details for a specific student.

```bash
# List students (defaults to 10)
activesoft-cli run --username <user> --password <pass>

# Fetch details for a specific student ID
activesoft-cli run --username <user> --password <pass> --student-id 103
```

### Responsible Parties (`responsaveis`)

Lists responsible parties or retrieves specific details.

```bash
# List responsible parties (defaults to 21)
activesoft-cli responsaveis --username <user> --password <pass> --limit 10

# Fetch details for a specific responsible party ID
activesoft-cli responsaveis --username <user> --password <pass> --responsavel-id 10188
```

## SDK Usage

You can also use the `SigaClient` directly in your Python scripts.

### Initialization

```python
from activesoft_cli import SigaClient

# Initialize and login
client = SigaClient(
    username="your-username", 
    password="your-password", 
    instituicao="TEST_INSTITUTION"
)

if client.login():
    print("Login successful")
else:
    print("Login failed")
    exit(1)
```

### Working with Students (Alunos)

```python
# List students
students = client.list_alunos(limit=10, offset=0)
for student in students:
    print(student)

# Get detailed info
detail = client.get_aluno_detail(aluno_id=103)
print(detail)
```

### Working with Responsible Parties (Responsaveis)

```python
# List responsible parties
guardians = client.list_responsaveis(limit=20)
for guardian in guardians:
    print(guardian)

# Get detailed info
guardian_detail = client.get_responsavel_detail(responsavel_id=10188)
print(guardian_detail)
```

## Requirements

- Python 3.8+
- `requests`
- `httpx`
- `loguru`
- `click`

## License

This project is licensed under the MIT License.
