ami-data-parser


Nameami-data-parser JSON
Version 0.2.12 PyPI version JSON
download
home_pageNone
SummaryAMI parser data
upload_time2025-07-24 13:37:19
maintainerNone
docs_urlNone
authorTatianno Alves
requires_pythonNone
licenseMIT License
keywords asterisk manager interface ami parser data
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AMI Data Parser

This repository aims to provide a tool to interpret and process data received from the Asterisk Manager Interface (AMI). It identifies and exposes status changes in queues and extensions in real-time, enabling more efficient integration with external systems or monitoring dashboards.

## Key Features
- Parsing data from the AMI.
- Detecting status changes in queues and extensions.
- Exposing processed data in an integration-friendly format.

## Repository
Github: https://github.com/tatianno/ami-data-parser

## Requirements
- Python 3.10 +

## Installation

Clone the repository and install the dependencies:

```sh
pip install -r requirements.txt
```

### Dependencies

The project requires the following packages:
- `pyst2`
- `ami-data-parser`

## Example Code

```python
import sys
from time import sleep
from ami_data_parser import Controller
from asterisk.manager import (
   Manager,
   ManagerAuthException,
   ManagerException,
   ManagerSocketException
)

AMI_HOST = '192.168.0.103'
AMI_USERNAME = 'DEV'
AMI_PASSWORD = 'gnew'

if __name__ == '__main__':

   manager = Manager()
   controller = Controller()

   try:
      # connect to the manager
      try:
         manager.connect(AMI_HOST)
         manager.login(AMI_USERNAME, AMI_PASSWORD)

         while True:
            queue_data = manager.command('queue show').response
            peer_data = manager.command('core show hints').response
            channel_data = manager.command('core show channels concise').response
            print('-----------queue data-----------------')
            print(controller.queue_update(queue_data))
            print('-----------peer data------------------')
            print(controller.peer_update(peer_data))
            print('-----------channel data---------------')
            print(controller.channel_update(channel_data))
            sleep(2)

      except ManagerSocketException:
         print("Error connecting to the manager")
         sys.exit(1)

      except ManagerAuthException:
         print("Error logging in to the manager")
         sys.exit(1)

      except ManagerException:
         print("Error")
         sys.exit(1)
      
      except KeyboardInterrupt:
         sys.exit(0)

   finally:
      manager.logoff()
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ami-data-parser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "asterisk manager interface ami parser data",
    "author": "Tatianno Alves",
    "author_email": "tferreiraalves@gmail.com",
    "download_url": null,
    "platform": null,
    "description": "# AMI Data Parser\n\nThis repository aims to provide a tool to interpret and process data received from the Asterisk Manager Interface (AMI). It identifies and exposes status changes in queues and extensions in real-time, enabling more efficient integration with external systems or monitoring dashboards.\n\n## Key Features\n- Parsing data from the AMI.\n- Detecting status changes in queues and extensions.\n- Exposing processed data in an integration-friendly format.\n\n## Repository\nGithub: https://github.com/tatianno/ami-data-parser\n\n## Requirements\n- Python 3.10 +\n\n## Installation\n\nClone the repository and install the dependencies:\n\n```sh\npip install -r requirements.txt\n```\n\n### Dependencies\n\nThe project requires the following packages:\n- `pyst2`\n- `ami-data-parser`\n\n## Example Code\n\n```python\nimport sys\nfrom time import sleep\nfrom ami_data_parser import Controller\nfrom asterisk.manager import (\n   Manager,\n   ManagerAuthException,\n   ManagerException,\n   ManagerSocketException\n)\n\nAMI_HOST = '192.168.0.103'\nAMI_USERNAME = 'DEV'\nAMI_PASSWORD = 'gnew'\n\nif __name__ == '__main__':\n\n   manager = Manager()\n   controller = Controller()\n\n   try:\n      # connect to the manager\n      try:\n         manager.connect(AMI_HOST)\n         manager.login(AMI_USERNAME, AMI_PASSWORD)\n\n         while True:\n            queue_data = manager.command('queue show').response\n            peer_data = manager.command('core show hints').response\n            channel_data = manager.command('core show channels concise').response\n            print('-----------queue data-----------------')\n            print(controller.queue_update(queue_data))\n            print('-----------peer data------------------')\n            print(controller.peer_update(peer_data))\n            print('-----------channel data---------------')\n            print(controller.channel_update(channel_data))\n            sleep(2)\n\n      except ManagerSocketException:\n         print(\"Error connecting to the manager\")\n         sys.exit(1)\n\n      except ManagerAuthException:\n         print(\"Error logging in to the manager\")\n         sys.exit(1)\n\n      except ManagerException:\n         print(\"Error\")\n         sys.exit(1)\n      \n      except KeyboardInterrupt:\n         sys.exit(0)\n\n   finally:\n      manager.logoff()\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "AMI parser data",
    "version": "0.2.12",
    "project_urls": null,
    "split_keywords": [
        "asterisk",
        "manager",
        "interface",
        "ami",
        "parser",
        "data"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f8bb208550b15b732e0a704af722336fffe3da9017c38bfecfdd154c22276fc5",
                "md5": "98f242e90bf10bb91e70206ffdec0b99",
                "sha256": "2fd6a5dfe0d480f65b70ab667141fb83fa497ae7ed3608b5db6a87bb6e5f43aa"
            },
            "downloads": -1,
            "filename": "ami_data_parser-0.2.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "98f242e90bf10bb91e70206ffdec0b99",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 44460,
            "upload_time": "2025-07-24T13:37:19",
            "upload_time_iso_8601": "2025-07-24T13:37:19.173379Z",
            "url": "https://files.pythonhosted.org/packages/f8/bb/208550b15b732e0a704af722336fffe3da9017c38bfecfdd154c22276fc5/ami_data_parser-0.2.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-24 13:37:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ami-data-parser"
}
        
Elapsed time: 1.68980s