{ "info": { "author": "Christian Visintin", "author_email": "christian.visintin1997@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Telecommunications Industry", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Topic :: Communications :: Telephony", "Topic :: Home Automation", "Topic :: Software Development :: Libraries" ], "description": "# ATtila\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-teal.svg)](https://opensource.org/licenses/MIT) [![Stars](https://img.shields.io/github/stars/ChristianVisintin/ATtila.svg)](https://github.com/ChristianVisintin/ATtila) [![Issues](https://img.shields.io/github/issues/ChristianVisintin/ATtila.svg)](https://github.com/ChristianVisintin/ATtila/) [![PyPI version](https://badge.fury.io/py/attila.svg)](https://pypi.org/project/attila/) [![Build](https://api.travis-ci.org/ChristianVisintin/ATtila.svg?branch=master)](https://travis-ci.org/ChristianVisintin/ATtila) [![codecov](https://codecov.io/gh/ChristianVisintin/ATtila/branch/master/graph/badge.svg)](https://codecov.io/gh/ChristianVisintin/ATtila)\n\nDeveloped by *Christian Visintin*\n\nCurrent Version: **1.2.0 (30/05/2020)**\n\n- [ATtila](#attila)\n - [Introduction](#introduction)\n - [Requirements](#requirements)\n - [Implementation](#implementation)\n - [Virtual Device](#virtual-device)\n - [ATScripts](#atscripts)\n - [Contributions](#contributions)\n - [Known Issues](#known-issues)\n - [Changelog](#changelog)\n - [Branches](#branches)\n - [License](#license)\n\n---\n\n```sh\npip3 install attila\n```\n\n## Introduction\n\nATtila is both a **Python3 \ud83d\udc0d module and a CLI utility**.\nThe module's purpose is to ease the communication with an RF module which uses AT commands. It is both possible to send single AT commands indicating what response is expected and AT scritps which indicate all the commands to send, the expected response for each command, what information to store for each command and define an alternative behaviour in case of unexpected responses. \nThese are the main functionalities that ATtila provides:\n\n- Fa\u00e7ade to communicate with the serial device\n- Sending AT commands and define the expected response for it using regex\n- Collect values from response and store them in the session storage\n- Define a command to execute in case the command fails\n- Sending individual AT command to RF module/modem through serial port and get the response for them\n\nATtila comes, as said before, with a binary (which can be used instead of the classic \"chat\" binary) or for anything you want.\nYou can run ATtila binary with\n\n```sh\npython3 -m attila\n#Or if installed, just\nattila\n```\n\n```txt\nUsage: attila [OPTION]... [FILE]\n\n With no FILE, run in interactive mode\n\n -p Use this device to communicate\n -b Use the specified baudrate to communicate\n -T Use the specified timeout as default to communicate\n -B Use the specified line break [CRLF, LF, CR, NONE] (Default: CRLF)\n -A Abort on failure (Default: True)\n -L Enable log and log to the specified log file (stdout is supported)\n -l Specify the log level (0: CRITICAL, 1: ERROR, 2: WARN, 3: INFO, 4: DEBUG) (Default: INFO)\n -v Be more verbose\n -q Be quiet (print only PRINT ESKs and ERRORS)\n -h Show this page\n```\n\n## Requirements\n\n- Python3.5 (>= 1.2.0)\n - Python3.4 (up to 1.1.x)\n- pyserial3\n\n## Implementation\n\nIn order to build your own implementation using ATtila these are the steps you'll need to follow:\n\n1. Import the AT Runtime Environment into your project\n\n The first thing you have to do is import the AT Runtime Environment and the exceptions it can raise in your project\n\n ```py\n from attila.atre import ATRuntimeEnvironment\n from attila.exceptions import ATREUninitializedError, ATRuntimeError, ATScriptNotFound, ATScriptSyntaxError, ATSerialPortError\n ``` \n\n2. Instantiate an ATRuntimeEnvironment object\n\n ```py\n atrunenv = ATRuntimeEnvironment(abort_on_failure)\n ```\n\n3. Configure the communicator\n\n This is the component which will communicate with your device\n\n ```py\n atrunenv.configure_communicator(device, baud_rate, default_timeout, line_break)\n ```\n\n4. Open the serial port\n\n Be careful, this function can return a ATSerialPortError\n\n ```py\n atrunenv.open_serial()\n ```\n\n5. Choose how to parse commands:\n\n 1. Parse an ATScript\n\n parse_ATScript can raise ATScriptNotFound or ATScriptSyntaxError\n\n ```py\n atrunenv.parse_ATScript(script_file)\n ```\n\n 2. Execute directly a command (or an ESK)\n\n ```py\n response = atrunenv.exec(command_str)\n ```\n\n 3. Add an ATCommand to the session\n\n ```py\n atrunenv.add_command(command_str)\n ```\n\n6. Execute commands:\n 1. Run everything at once and then get a list of ATResponse\n\n if abort_on_failure is True, the ATRE will raise ATRuntimeError during execution \n\n ```py\n response_list = atrunenv.run()\n ```\n\n 2. Run one command a time (if abort_on_failure is True, the ATRE will raise ATRuntimeError):\n\n ```py\n response = atrunenv.exec_next()\n ```\n\n7. Collect the values you need\n\n ```py\n rssi = atrunenv.get_session_value(\"rssi\")\n ```\n\n8. Close serial\n\n ```py\n atrunenv.close_serial()\n ```\n\n### Virtual Device\n\nSince version 1.1.0, it is possible to use a virtual serial device, instead of a real one. This has been introduced for tests purpose, but can actually used in cases where you need to emulate a serial device and you want to keep using ATtila.\nIn this case, in the ATRE, instead of using configure_communicator use:\n\n```py\ndef configure_virtual_communicator(self, serial_port, baud_rate, timeout = None, line_break = \"\\r\\n\", read_callback = None, write_callback = None, in_waiting_callback = None)\n```\n\nThe virtual communicator, in addition to the standard one, requires a read, a write and an in waiting callback. These callbacks must replace the I/O operations of the serial device, with something else (e.g. a socket with an HTTP request)\n\n## ATScripts\n\nATtila uses its own syntax to communicate with the serial device, which is called **ATScript** (ATS).\nThe basic syntax for it is:\n\n```txt\nCOMMAND;;RESPONSE_EXPR;;DELAY;;TIMEOUT;;[\"COLLECTABLE1\",...];;DOPPELGANGER;;DOPPELGANGER_RESPONSE\n```\n\nTo know more about ATS see the [ATScript documentation](./docs/atscript.md)\n\n---\n\n## Contributions\n\nContributions are welcome! \ud83d\ude09\n\nIf you think you can contribute to ATtila, please follow ATtila's [Contributions Guide](CONTRIBUTING.md)\n\n## Known Issues\n\nNone, as far as I know at least.\n\n## Changelog\n\nSee Changelog [HERE](CHANGELOG.md)\n\n## Branches\n\n- master: stable only\n- dev: main development branch\n- other features\n\n---\n\n## License\n\n```txt\nMIT License\n\nCopyright (c) 2019 Christian Visintin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ChristianVisintin/ATtila", "keywords": "AT commands,IOT,wireless,radio frequency,modem,rf modules", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "attila", "package_url": "https://pypi.org/project/attila/", "platform": "", "project_url": "https://pypi.org/project/attila/", "project_urls": { "Homepage": "https://github.com/ChristianVisintin/ATtila" }, "release_url": "https://pypi.org/project/attila/1.2.0/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Python module to communicate easily with modems and RF modules using AT commands", "version": "1.2.0", "yanked": false, "yanked_reason": null }, "last_serial": 7359783, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "feb59bee4348714d97af65149836e49a", "sha256": "abc5e4973d4cc456817a044335b03337b7cc6fe4f2bf628de429143e92511e3b" }, "downloads": -1, "filename": "attila-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "feb59bee4348714d97af65149836e49a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 34832, "upload_time": "2019-10-07T20:27:45", "upload_time_iso_8601": "2019-10-07T20:27:45.130513Z", "url": "https://files.pythonhosted.org/packages/35/21/e3f71c00fc64d6eff0a477cf99ad0c907de2673ceaf90693b09398184a0a/attila-1.0.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "4ca9b79b6e9a1f4a21317890d3e37ecf", "sha256": "7003342bfb39f81092e121bb1c8433ce05777d7d1e8075bb9eb5bfe4ff2576dd" }, "downloads": -1, "filename": "attila-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4ca9b79b6e9a1f4a21317890d3e37ecf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 19383, "upload_time": "2019-10-07T20:27:47", "upload_time_iso_8601": "2019-10-07T20:27:47.962925Z", "url": "https://files.pythonhosted.org/packages/6d/6d/d21de2248730ac438dda64f1e121a3681c4a3304ee53ab2eb3e3b605ae6d/attila-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "9a0ef63186b0cdee23338b55895512db", "sha256": "0168a0b29b3e295225935dd3906b2dc4c6ec3fe339664d21c9a46556353f48f7" }, "downloads": -1, "filename": "attila-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9a0ef63186b0cdee23338b55895512db", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 34533, "upload_time": "2019-10-07T20:29:27", "upload_time_iso_8601": "2019-10-07T20:29:27.879890Z", "url": "https://files.pythonhosted.org/packages/50/4a/699a92dcd98cc931f433d281cd3e260826e70f96e46c730fc89a44f7b5a7/attila-1.0.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "fc0e47265be9e33f5b23cb3201aab1e1", "sha256": "d5a91f623826d3183f8700cc6c478b57ee247fbb2f54e00fe502f9654ad0833b" }, "downloads": -1, "filename": "attila-1.0.1.tar.gz", "has_sig": false, "md5_digest": "fc0e47265be9e33f5b23cb3201aab1e1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 19239, "upload_time": "2019-10-07T20:29:29", "upload_time_iso_8601": "2019-10-07T20:29:29.727702Z", "url": "https://files.pythonhosted.org/packages/43/55/279f8c1c1f069baee73ec6c56a1d67e83a96c668dc6153c2cf6ad419a355/attila-1.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "0d4719b39f93bf6a21f0e21feafc8843", "sha256": "7fa3f166d98a2abecc53dc16469889ead4da7cb9496a8bfb96a6b6ae6fea941b" }, "downloads": -1, "filename": "attila-1.0.2.tar.gz", "has_sig": false, "md5_digest": "0d4719b39f93bf6a21f0e21feafc8843", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 26107, "upload_time": "2019-10-12T16:33:11", "upload_time_iso_8601": "2019-10-12T16:33:11.355111Z", "url": "https://files.pythonhosted.org/packages/1b/71/985e74b6f9f48c83a85a39adab0335c9f8379363b72cfc529e46f4d89133/attila-1.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "6309adc44aa1a3c8b288db1ef6a6dfbe", "sha256": "eb8645ac1c4b4337df751847d5787f8e0e78a1100bf477d52f5211e62253ad57" }, "downloads": -1, "filename": "attila-1.0.3.tar.gz", "has_sig": false, "md5_digest": "6309adc44aa1a3c8b288db1ef6a6dfbe", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 27622, "upload_time": "2019-10-12T16:54:09", "upload_time_iso_8601": "2019-10-12T16:54:09.744941Z", "url": "https://files.pythonhosted.org/packages/81/1d/9dee123ac7dce96bd94363baeec5ef9ede4a2dee4f1412afa6fecf6847a9/attila-1.0.3.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "43820f1e2547d96cd8d521b802c27687", "sha256": "4148c6de12b3b3e70039d0554a8377e5ab3b8e3983b692fbc6aaab3583a62ae0" }, "downloads": -1, "filename": "attila-1.0.4.tar.gz", "has_sig": false, "md5_digest": "43820f1e2547d96cd8d521b802c27687", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 27685, "upload_time": "2019-10-13T08:55:23", "upload_time_iso_8601": "2019-10-13T08:55:23.882790Z", "url": "https://files.pythonhosted.org/packages/2c/53/dfb9930b1020a1fc0b2b0d0e7d3ccce2ffb9c8228862594a136a167b2827/attila-1.0.4.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "7bbccf335f836e0217e9cecad46816f7", "sha256": "0dd21301176dc23a6f814cf455fe3e8a8f666b8182a670528fd88fc56b35bbce" }, "downloads": -1, "filename": "attila-1.1.0.tar.gz", "has_sig": false, "md5_digest": "7bbccf335f836e0217e9cecad46816f7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 28621, "upload_time": "2019-10-26T14:40:30", "upload_time_iso_8601": "2019-10-26T14:40:30.511169Z", "url": "https://files.pythonhosted.org/packages/18/7c/1356a4889f9559e5745adc2d78442483f46180dbea5c0c857907768a01f5/attila-1.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "fafb0047a87484538f1fb51cb18ea823", "sha256": "9ec2a8ee92e886e15526976d805e985cc9af37d01e5f1cbf6cbac1789f53532a" }, "downloads": -1, "filename": "attila-1.1.1.tar.gz", "has_sig": false, "md5_digest": "fafb0047a87484538f1fb51cb18ea823", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 30680, "upload_time": "2019-10-26T14:52:11", "upload_time_iso_8601": "2019-10-26T14:52:11.152587Z", "url": "https://files.pythonhosted.org/packages/e6/e4/b39bba3514d0c9a8f90e109343e52658dcedd84c4e366b9c6de8a278a031/attila-1.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "e609535e145e2216e69be9ccd1a85ae3", "sha256": "084a00cbcc6a75f4b95aebd2339ceb05b95d6f342240e140d94065097ae97d17" }, "downloads": -1, "filename": "attila-1.1.2.tar.gz", "has_sig": false, "md5_digest": "e609535e145e2216e69be9ccd1a85ae3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 30408, "upload_time": "2019-10-29T09:27:39", "upload_time_iso_8601": "2019-10-29T09:27:39.965654Z", "url": "https://files.pythonhosted.org/packages/66/84/e7f7ebe8bea881b801aa12a51a555b65ff81df9efe8902870db80da5bded/attila-1.1.2.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "d0b3cf93e9a13b974f176df378cc1dde", "sha256": "bf9accb6f44324aa11b5db148d41a2430c361eb277fc0a805454499491f77c61" }, "downloads": -1, "filename": "attila-1.1.3.tar.gz", "has_sig": false, "md5_digest": "d0b3cf93e9a13b974f176df378cc1dde", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 30499, "upload_time": "2019-12-07T16:34:21", "upload_time_iso_8601": "2019-12-07T16:34:21.279764Z", "url": "https://files.pythonhosted.org/packages/38/d1/d672e93dee5b7d0edbfd5e6d8814a0848b4ca761e9dd445a18839b168cda/attila-1.1.3.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "dfff42de0f8777f06f94853fc8884aee", "sha256": "974858b935c1a7ea85aa612b0fb94c2d53a4483c5a9d3552065dd79762894923" }, "downloads": -1, "filename": "attila-1.1.4.tar.gz", "has_sig": false, "md5_digest": "dfff42de0f8777f06f94853fc8884aee", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 31138, "upload_time": "2020-03-05T20:08:49", "upload_time_iso_8601": "2020-03-05T20:08:49.657449Z", "url": "https://files.pythonhosted.org/packages/2b/13/c7e2fa1953dbfd46b67dd3fc37f8484dabc0b5cc5cfa1b30dbaf5594af97/attila-1.1.4.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "6d54f89eb7035fcf9861ae3387d16507", "sha256": "e48e83be68af10bdb1b743f741b063d8f7fb666aa8c031deb314d6919a9f7eac" }, "downloads": -1, "filename": "attila-1.1.5.tar.gz", "has_sig": false, "md5_digest": "6d54f89eb7035fcf9861ae3387d16507", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 31570, "upload_time": "2020-03-09T20:06:28", "upload_time_iso_8601": "2020-03-09T20:06:28.742148Z", "url": "https://files.pythonhosted.org/packages/7c/15/ca7e6a2bd55c4f9b436291ea43fa986daf703f6011c379ddb0dc3d27aabb/attila-1.1.5.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.6": [ { "comment_text": "", "digests": { "md5": "f295f0b1d7653bba81b27d4bdb53cd89", "sha256": "1b9b48aea37f4aff305d0055ae609a39c5f8c79bea1df6a433c7edab7e1d3546" }, "downloads": -1, "filename": "attila-1.1.6.tar.gz", "has_sig": false, "md5_digest": "f295f0b1d7653bba81b27d4bdb53cd89", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 24553, "upload_time": "2020-03-25T13:41:03", "upload_time_iso_8601": "2020-03-25T13:41:03.949579Z", "url": "https://files.pythonhosted.org/packages/63/a2/e1d7358e10acee9a1b178b095719413c110c4f9b588d356d15bc52aab521/attila-1.1.6.tar.gz", "yanked": false, "yanked_reason": null } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "8a32127989ccd5f91e6c89f302353ccb", "sha256": "c2055e1b82717622bb3e74d4ae3630e60dddd74814aaf197159d3ad2611c4ee4" }, "downloads": -1, "filename": "attila-1.2.0.tar.gz", "has_sig": false, "md5_digest": "8a32127989ccd5f91e6c89f302353ccb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 21482, "upload_time": "2020-05-30T15:49:28", "upload_time_iso_8601": "2020-05-30T15:49:28.739111Z", "url": "https://files.pythonhosted.org/packages/27/bc/ff48fa1c2e6181a6930e9b9b3bd68c903477834d49e5b44fa79e33cad401/attila-1.2.0.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a32127989ccd5f91e6c89f302353ccb", "sha256": "c2055e1b82717622bb3e74d4ae3630e60dddd74814aaf197159d3ad2611c4ee4" }, "downloads": -1, "filename": "attila-1.2.0.tar.gz", "has_sig": false, "md5_digest": "8a32127989ccd5f91e6c89f302353ccb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 21482, "upload_time": "2020-05-30T15:49:28", "upload_time_iso_8601": "2020-05-30T15:49:28.739111Z", "url": "https://files.pythonhosted.org/packages/27/bc/ff48fa1c2e6181a6930e9b9b3bd68c903477834d49e5b44fa79e33cad401/attila-1.2.0.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }