{ "info": { "author": "Justin Palmer", "author_email": "jpavlav@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Systems Administration" ], "description": "\n# PyConvertAlert\n\nPyConvertAlert makes it easy to take an arbitrary alert from some kind of alerting system (Uptime Robot, Rackspace Intelligence) and convert it into an Alert Manager (Prometheus) alert.\n\n\n### Getting Started\n\nThe latest stable release is available from PyPI:\n\n```\npip install pyconvertalert\n```\n\nOtherwise you can install from git:\n\n```\npip install git+https://github.com/jpavlav/PyConvertAlert\n```\n\n### Usage\n\n```python\n>>> from pyconvertalert import Converter\n>>>\n>>> test_lookup_dict_1 = {\n... \"values\": [\n... {\n... \"people\": [\n... {\n... \"email\": \"jim@jim.com\",\n... \"phone\": \"111-111-1111\"\n... }\n... ]\n... }\n... ]\n... }\n>>>\n>>>\n>>> test_mapper_dict_1 = {\n... \"labels\": {\n... \"email_address\": \"email\",\n... \"phone_number\": \"phone\"\n... }\n... }\n>>> convert = Converter(mapper=test_mapper_dict_1)\n>>> convert.convert_it(test_lookup_dict_1)\n{'labels': {'email_address': 'jim@jim.com', 'phone_number': '111-111-1111'}}\n```\n\n### Further Usage\nIn some cases, there will be more than one key that matches a lookup. In this\ncase, the value returned in our converted dict will be a list containing all of\nthe values that match this key. In order to handle a situation where we need to\nbe more specific, it is possible to specify a list of keys to drill down on a\nspecific value. Here is an example:\n\n```python\n>>> test_lookup_dict_2 = {\n... \"flowers\": [\n... {\n... \"best_flower\": {\n... \"name\": \"Orchid\",\n... \"scientific_name\": \"Orchidaceae\"\n... },\n... \"wild_flower\": {\n... \"name\": \"Gold Yarrow\",\n... \"scientific_name\": \"Achillea filipendulinaa\"\n... }\n... }\n... ]\n... }\n>>>\n>>> test_mapper_dict_2 = {\n... \"labels\": {\n... \"best_flower_name\": ['best_flower', 'name'],\n... \"best_flower_scientific_name\": ['best_flower',\n... 'scientific_name']\n... }\n... }\n>>>\n>>>\n>>> convert = Converter(mapper=test_mapper_dict_2)\n>>> convert.convert_it(test_lookup_dict_2)\n{'labels': {'best_flower_name': 'Orchid', 'best_flower_scientific_name': 'Orchidaceae'}}\n```\nAbove, we see that we were able to get the 'best_flower' 'scientific_name' by\nspecifying a list of keys to search through. We first return the value from the key 'best_flower', then return the value from the key 'name'.\n## Running the tests\n\nShould be as simple as:\n\n```\npython -m unittest test_py_convert_alert.py\n```\n\n## Contributing\n1. Fork it.\n2. Create a branch describing either the issue or feature you're working.\n3. Making changes, committing along the way.\n4. Follow PEP8, except where ridiculous.\n5. Include tests for any functionality changes.\n6. Push the changes and create a pull request :D.\n\n## Built With\n\n* [Python3](https://www.python.org/downloads/) - Beautiful language.\n\n## Authors\n\n* **Justin Palmer** - *Urrverything* - [Me](https://github.com/jpavlav)\n\n## Acknowledgments\n\n* Kenneth Reitz -> [setup](https://github.com/kennethreitz/setup.py) - Thanks!\n* Kamori -> [Cool Guy](https://github.com/Kamori) - Thanks to you as well!\n\n\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/jpavlav/PyConvertAlert", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyconvertalert", "package_url": "https://pypi.org/project/pyconvertalert/", "platform": "", "project_url": "https://pypi.org/project/pyconvertalert/", "project_urls": { "Homepage": "https://github.com/jpavlav/PyConvertAlert" }, "release_url": "https://pypi.org/project/pyconvertalert/0.1.1/", "requires_dist": [ "six (>=1.11.0)", "nested-lookup (>=0.2.1)" ], "requires_python": ">=3.6.0", "summary": "Convert arbitrary json alerts to Alert Manager alerts", "version": "0.1.1" }, "last_serial": 4458528, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "95a655d7799a31edba05cb28bb70716b", "sha256": "bc7918ec53235d93c4016c7e57e6199cb4a99940548e0b87f98abf43d2684535" }, "downloads": -1, "filename": "pyconvertalert-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "95a655d7799a31edba05cb28bb70716b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 6514, "upload_time": "2018-11-06T01:13:34", "url": "https://files.pythonhosted.org/packages/e9/88/00e2fec2bbddebc9e8ce9342eca9d92ff49206035cb74eaeb1ca04c5fefb/pyconvertalert-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c653bcf28a916579ab5e0493b21141f", "sha256": "a966bd83c9513ff758dc34af344603976a4a18d11b504c2ee8f114cf02943f18" }, "downloads": -1, "filename": "pyconvertalert-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9c653bcf28a916579ab5e0493b21141f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 6026, "upload_time": "2018-11-06T01:13:35", "url": "https://files.pythonhosted.org/packages/94/7c/ee8b01af34de1715d9c093b8556de98630d47ed5a1b172cb08c0b9bdff2c/pyconvertalert-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f4cde46d931e533a0ca55af88f09e9fb", "sha256": "84e63de42f7e8b8e05c929c6d65b56d22a1a93097339ced7abc5fbed88dd4fda" }, "downloads": -1, "filename": "pyconvertalert-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f4cde46d931e533a0ca55af88f09e9fb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 7108, "upload_time": "2018-11-06T18:38:55", "url": "https://files.pythonhosted.org/packages/5b/4a/26b82a57f8207e635f53629cd434634c02fb04fc6b5d0d34ca54a916f900/pyconvertalert-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4351d66f9b4ad0857bf855400baf221d", "sha256": "d2801513fd94986b2eaeaa31c16c31e8b9c491974f77725644bf3738efe38ffa" }, "downloads": -1, "filename": "pyconvertalert-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4351d66f9b4ad0857bf855400baf221d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 6708, "upload_time": "2018-11-06T18:38:57", "url": "https://files.pythonhosted.org/packages/72/2f/6f19a0d7f04060e5123352f46d41ee1ea32c3486b3f6fd3b0926c3f46d87/pyconvertalert-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f4cde46d931e533a0ca55af88f09e9fb", "sha256": "84e63de42f7e8b8e05c929c6d65b56d22a1a93097339ced7abc5fbed88dd4fda" }, "downloads": -1, "filename": "pyconvertalert-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f4cde46d931e533a0ca55af88f09e9fb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6.0", "size": 7108, "upload_time": "2018-11-06T18:38:55", "url": "https://files.pythonhosted.org/packages/5b/4a/26b82a57f8207e635f53629cd434634c02fb04fc6b5d0d34ca54a916f900/pyconvertalert-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4351d66f9b4ad0857bf855400baf221d", "sha256": "d2801513fd94986b2eaeaa31c16c31e8b9c491974f77725644bf3738efe38ffa" }, "downloads": -1, "filename": "pyconvertalert-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4351d66f9b4ad0857bf855400baf221d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 6708, "upload_time": "2018-11-06T18:38:57", "url": "https://files.pythonhosted.org/packages/72/2f/6f19a0d7f04060e5123352f46d41ee1ea32c3486b3f6fd3b0926c3f46d87/pyconvertalert-0.1.1.tar.gz" } ] }