Skip to main content

Python SDK and CLI tool for Activesoft Siga automation

Project description

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, and sending messages.

Installation

Install via pip:

pip install activesoft-cli

Or from source:

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.

Configuration

You can provide credentials via flags or environment variables:

  • --username / SIGA_USERNAME
  • --password / SIGA_PASSWORD
  • --instituicao / SIGA_INSTITUICAO

The CLI automatically saves your session (cookies) to a local JSON file: ~/.activesoft_siga_<instituicao>_<username>.json

Subsequent commands will reuse this session, avoiding full re-authentication. If the session expires, the CLI will automatically attempt to re-login.

You can also specify a custom session path when using the SDK:

client = SigaClient(..., session_path="/path/to/session.json")

Commands

Student Management (students)

Lists students or retrieves details for a specific student.

# List students (defaults to 10)
activesoft-cli students

# Fetch details for a specific student ID
activesoft-cli students --id 103

Responsible Parties (responsaveis)

Lists responsible parties or retrieves specific details.

# List responsible parties (defaults to 21)
activesoft-cli responsaveis --limit 10

# Fetch details for a specific responsible party ID
activesoft-cli responsaveis --id 10188

Messaging (send-message)

Sends a message to a student/responsible party.

activesoft-cli send-message \
  --student-id 4907 \
  --destinatario-id 13578 \
  --message "Your message here" \
  --title "Aviso"

SDK Usage

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

Initialization

import asyncio
from activesoft_cli import SigaClient

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

    async with client.client: # Close client manually if not using context manager
        if await client.login():
            # List students
            students = await client.list_alunos(limit=10)
            print(students)

if __name__ == "__main__":
    asyncio.run(main())

Requirements

  • Python 3.8+
  • httpx
  • loguru
  • click

License

This project is licensed under the MIT License.

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

activesoft_cli-0.1.4.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

activesoft_cli-0.1.4-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file activesoft_cli-0.1.4.tar.gz.

File metadata

  • Download URL: activesoft_cli-0.1.4.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for activesoft_cli-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6cf22e085002cc2c27cace34e82f5785fd668b6a75b2a9f0fb04c3e3711a1f30
MD5 8dece384b11232a88e6280e57a34a023
BLAKE2b-256 3fc0871bd1385a070770a56f7f5217ec4872c63dc59d59d9091f1bdbc1fd03cc

See more details on using hashes here.

File details

Details for the file activesoft_cli-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: activesoft_cli-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for activesoft_cli-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6d2a99fe3b79209ffa005d2eedebe0c2e91569af9c61e97e097df63462ec6397
MD5 3fcff03a69a8e8c6d8de5f03164fb800
BLAKE2b-256 433efc473f22193dcf5445593bbfec020e14146d095b51a56b5dc6ed4f0f4943

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