{"id":20338374,"url":"https://github.com/alerta/python-alerta-client","last_synced_at":"2025-04-09T15:08:26.241Z","repository":{"id":15035507,"uuid":"17761383","full_name":"alerta/python-alerta-client","owner":"alerta","description":"Unified command-line tool and python SDK for alerta","archived":false,"fork":false,"pushed_at":"2024-10-28T10:32:35.000Z","size":958,"stargazers_count":30,"open_issues_count":7,"forks_count":37,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-09T15:08:20.802Z","etag":null,"topics":["alerta","python","python-sdk"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/alerta/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hacklabr/mapasculturais-app","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alerta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"satterly"}},"created_at":"2014-03-14T21:45:39.000Z","updated_at":"2024-11-07T15:51:52.000Z","dependencies_parsed_at":"2025-03-26T09:11:14.421Z","dependency_job_id":"a1250e65-31ad-4bea-83d4-efaa11c63982","html_url":"https://github.com/alerta/python-alerta-client","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alerta%2Fpython-alerta-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alerta%2Fpython-alerta-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alerta%2Fpython-alerta-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alerta%2Fpython-alerta-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alerta","download_url":"https://codeload.github.com/alerta/python-alerta-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055283,"owners_count":21040157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alerta","python","python-sdk"],"created_at":"2024-11-14T21:12:55.493Z","updated_at":"2025-04-09T15:08:26.223Z","avatar_url":"https://github.com/alerta.png","language":"Python","funding_links":["https://github.com/sponsors/satterly"],"categories":[],"sub_categories":[],"readme":"Alerta Command-Line Tool\n========================\n\n[![Actions Status](https://github.com/alerta/python-alerta-client/workflows/CI%20Tests/badge.svg)](https://github.com/alerta/python-alerta-client/actions)\n [![Slack chat](https://img.shields.io/badge/chat-on%20slack-blue?logo=slack)](https://slack.alerta.dev) [![Coverage Status](https://coveralls.io/repos/github/alerta/python-alerta-client/badge.svg?branch=master)](https://coveralls.io/github/alerta/python-alerta-client?branch=master)\n\nUnified command-line tool, terminal GUI and python SDK for the Alerta monitoring system.\n\n![screen shot](/docs/images/alerta-top-80x25.png?raw=true\u0026v=1)\n\nRelated projects can be found on the Alerta Org Repo at \u003chttps://github.com/alerta/\u003e.\n\nInstallation\n------------\n\nTo install the Alerta CLI tool run::\n\n    $ pip install alerta\n\nConfiguration\n-------------\n\nOptions can be set in a configuration file, as environment variables or on the command line.\nProfiles can be used to easily switch between different configuration settings.\n\n| Option            | Config File | Environment Variable       | Optional Argument               | Default                   |\n|-------------------|-------------|----------------------------|---------------------------------|---------------------------|\n| file              | n/a         | ``ALERTA_CONF_FILE``       | n/a                             | ``~/.alerta.conf``        |\n| profile           | profile     | ``ALERTA_DEFAULT_PROFILE`` | ``--profile PROFILE``           | None                      |\n| endpoint          | endpoint    | ``ALERTA_ENDPOINT``        | ``--endpoint-url URL``          | ``http://localhost:8080`` |\n| key               | key         | ``ALERTA_API_KEY``         | n/a                             | None                      |\n| timezone          | timezone    | n/a                        | n/a                             | Europe/London             |\n| SSL verify        | sslverify   | ``REQUESTS_CA_BUNDLE``     | n/a                             | verify SSL certificates   |\n| SSL client cert   | sslcert     | n/a                        | n/a                             | None                      |\n| SSL client key    | sslkey      | n/a                        | n/a                             | None                      |\n| timeout           | timeout     | n/a                        | n/a                             | 5s TCP connection timeout |\n| output            | output      | n/a                        | ``--output-format OUTPUT``      | simple                    |\n| color             | color       | ``CLICOLOR``               | ``--color``, ``--no-color``     | color on                  |\n| debug             | debug       | ``DEBUG``                  | ``--debug``                     | no debug                  |\n\nExample\n-------\n\nConfiguration file ``~/.alerta.conf``::\n\n    [DEFAULT]\n    timezone = Australia/Sydney\n    # output = psql\n    profile = production\n\n    [profile production]\n    endpoint = https://api.alerta.io\n    key = demo-key\n\n    [profile development]\n    endpoint = https://localhost:8443\n    sslverify = off\n    timeout = 10.0\n    debug = yes\n\nEnvironment Variables\n---------------------\n\nSet environment variables to use production configuration settings by default::\n\n    $ export ALERTA_CONF_FILE=~/.alerta.conf\n    $ export ALERTA_DEFAULT_PROFILE=production\n\n    $ alerta query\n\nAnd to switch to development configuration settings when required use the ``--profile`` option::\n\n    $ alerta --profile development query\n\nUsage\n-----\n\n    $ alerta\n    Usage: alerta [OPTIONS] COMMAND [ARGS]...\n\n      Alerta client unified command-line tool.\n\n    Options:\n      --config-file \u003cFILE\u003e      Configuration file.\n      --profile \u003cPROFILE\u003e       Configuration profile.\n      --endpoint-url \u003cURL\u003e      API endpoint URL.\n      --output-format \u003cFORMAT\u003e  Output format. eg. simple, grid, psql, presto, rst\n      --color / --no-color      Color-coded output based on severity.\n      --debug                   Debug mode.\n      --help                    Show this message and exit.\n\n    Commands:\n      ack         Acknowledge alerts\n      blackout    Suppress alerts\n      blackouts   List alert suppressions\n      close       Close alerts\n      customer    Add customer lookup\n      customers   List customer lookups\n      delete      Delete alerts\n      heartbeat   Send a heartbeat\n      heartbeats  List heartbeats\n      help        Show this help\n      history     Show alert history\n      key         Create API key\n      keys        List API keys\n      login       Login with user credentials\n      logout      Clear login credentials\n      perm        Add role-permission lookup\n      perms       List role-permission lookups\n      query       Search for alerts\n      raw         Show alert raw data\n      revoke      Revoke API key\n      send        Send an alert\n      status      Display status and metrics\n      tag         Tag alerts\n      token       Display current auth token\n      unack       Un-acknowledge alerts\n      untag       Untag alerts\n      update      Update alert attributes\n      uptime      Display server uptime\n      user        Update user\n      users       List users\n      version     Display version info\n      whoami      Display current logged in user\n\nPython SDK\n==========\n\nThe alerta client python package can also be used as a Python SDK.\n\nExample\n-------\n\n    \u003e\u003e\u003e from alertaclient.api import Client\n\n    \u003e\u003e\u003e client = Client(key='NGLxwf3f4-8LlYN4qLjVEagUPsysn0kb9fAkAs1l')\n    \u003e\u003e\u003e client.send_alert(environment='Production', service=['Web', 'Application'], resource='web01', event='HttpServerError', value='501', text='Web server unavailable.')\n    Alert(id='42254ef8-7258-4300-aaec-a9ad7d3a84ff', environment='Production', resource='web01', event='HttpServerError', severity='normal', status='closed', customer=None)\n\n    \u003e\u003e\u003e [a.id for a in client.search([('resource','~we.*01'), ('environment!', 'Development')])]\n    ['42254ef8-7258-4300-aaec-a9ad7d3a84ff']\n\n    \u003e\u003e\u003e client.heartbeat().serialize()['status']\n    'ok'\n\nLicense\n-------\n\n    Alerta monitoring system and console\n    Copyright 2012-2024 Nick Satterly\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falerta%2Fpython-alerta-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falerta%2Fpython-alerta-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falerta%2Fpython-alerta-client/lists"}