Este exemplo usa a biblioteca routeros do PyPI (GitHub) para acessar a API MikroTik e extrair a identidade do sistema.
routeros_minimal_example.py
#!/usr/bin/env python3
from routeros import login
routeros = login('admin', 'abc123abc', '192.168.88.1')
output = routeros('/system/identity/print')
# Extract the one identity string from the list of dictionaries
print(output[0]['name'])If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow