# Simple HealthChecks Wrapper
[<img src="https://img.shields.io/pypi/v/healthchecks-wrapper.svg">](https://pypi.org/project/healthchecks-wrapper)
[<img src="https://readthedocs.org/projects/healthchecks-wrapper/badge/?version=latest">](https://healthchecks-wrapper.readthedocs.io/en/latest/?badge=latest)
[](https://www.buymeacoffee.com/samarpanrai)
Context manager around service provided by [healthchecks.io](https://healthchecks.io/) that will ping your check URL for both success and failure (includes stack trace).
### Features
* Zero requirements outside the standard library
* Easily report the status of your python jobs
* Supports both sync and async jobs
### Getting started
Make a free account with at [healthchecks.io](https://healthchecks.io/) and create a check. You need to copy the url of the check endpoint.
Install the library
```bash
pip install healthchecks-wrapper
```
Use it in your code
```python
from healthchecks_wrapper import HealthCheck
import asyncio
valid_ping_url = "https://hc-ping.com/b2b308a5-765c-4136-8d0a-2ff0b906e3ee" # Replace with your job url
# Sync jobs
with HealthCheck(valid_ping_url):
# Do your job
print("hi")
# Async jobs requires a bit more boiler plate code
async def print_hi():
async with HealthCheck(valid_ping_url):
# Do your job
await asyncio.sleep(1) # Read database async
print("hi")
def main():
loop = asyncio.get_event_loop()
loop.run_until_complete(print_hi())
loop.close()
main()
```
[](https://www.buymeacoffee.com/samarpanrai)
### Credits
This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage)
project template.
Raw data
{
"_id": null,
"home_page": "https://github.com/samarpan-rai/healthchecks_wrapper",
"name": "healthchecks-wrapper",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "healthchecks_context_manager",
"author": "Samarpan Rai",
"author_email": "samarpan-rai@live.com",
"download_url": "https://files.pythonhosted.org/packages/01/5d/c44d8b4a2e2fe658c923b7f1f664f5fbaff3377244a4401c2fe3de535f0e/healthchecks_wrapper-0.1.6.tar.gz",
"platform": null,
"description": "# Simple HealthChecks Wrapper\n\n\n[<img src=\"https://img.shields.io/pypi/v/healthchecks-wrapper.svg\">](https://pypi.org/project/healthchecks-wrapper)\n[<img src=\"https://readthedocs.org/projects/healthchecks-wrapper/badge/?version=latest\">](https://healthchecks-wrapper.readthedocs.io/en/latest/?badge=latest)\n[](https://www.buymeacoffee.com/samarpanrai)\n\nContext manager around service provided by [healthchecks.io](https://healthchecks.io/) that will ping your check URL for both success and failure (includes stack trace).\n\n### Features\n\n* Zero requirements outside the standard library\n* Easily report the status of your python jobs\n* Supports both sync and async jobs\n\n### Getting started\nMake a free account with at [healthchecks.io](https://healthchecks.io/) and create a check. You need to copy the url of the check endpoint.\n\nInstall the library\n\n```bash\npip install healthchecks-wrapper\n```\n\nUse it in your code\n\n```python\nfrom healthchecks_wrapper import HealthCheck\nimport asyncio\nvalid_ping_url = \"https://hc-ping.com/b2b308a5-765c-4136-8d0a-2ff0b906e3ee\" # Replace with your job url\n\n# Sync jobs\nwith HealthCheck(valid_ping_url):\n # Do your job\n print(\"hi\")\n\n# Async jobs requires a bit more boiler plate code\nasync def print_hi():\n async with HealthCheck(valid_ping_url):\n # Do your job\n await asyncio.sleep(1) # Read database async\n print(\"hi\")\n\ndef main():\n loop = asyncio.get_event_loop()\n loop.run_until_complete(print_hi())\n loop.close()\n\nmain()\n```\n\n\n[](https://www.buymeacoffee.com/samarpanrai)\n\n### Credits\n\nThis package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage)\n project template.\n\n\n\n\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Context manager around service provided by HealthChecks for easy use",
"version": "0.1.6",
"split_keywords": [
"healthchecks_context_manager"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6eadc0e41399169055a3b13f83b37c5cde18ef8c6fb395eeb21839bcda843bc4",
"md5": "055eafe6a264ac04a5bd3d585626e6e4",
"sha256": "4cdd4477442cb6df318ea0c5af3fa4395f4244508f5ad82f8d7491c731f83f56"
},
"downloads": -1,
"filename": "healthchecks_wrapper-0.1.6-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "055eafe6a264ac04a5bd3d585626e6e4",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 5188,
"upload_time": "2023-01-27T20:21:28",
"upload_time_iso_8601": "2023-01-27T20:21:28.524078Z",
"url": "https://files.pythonhosted.org/packages/6e/ad/c0e41399169055a3b13f83b37c5cde18ef8c6fb395eeb21839bcda843bc4/healthchecks_wrapper-0.1.6-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "015dc44d8b4a2e2fe658c923b7f1f664f5fbaff3377244a4401c2fe3de535f0e",
"md5": "af1844f3f5fb34388fa81f177773e369",
"sha256": "df35820227e3cfcc23f7fd2add20eb2f4a39032dc5343a970867b7f2caf20d56"
},
"downloads": -1,
"filename": "healthchecks_wrapper-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "af1844f3f5fb34388fa81f177773e369",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 11586,
"upload_time": "2023-01-27T20:21:29",
"upload_time_iso_8601": "2023-01-27T20:21:29.627487Z",
"url": "https://files.pythonhosted.org/packages/01/5d/c44d8b4a2e2fe658c923b7f1f664f5fbaff3377244a4401c2fe3de535f0e/healthchecks_wrapper-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-27 20:21:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "samarpan-rai",
"github_project": "healthchecks_wrapper",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "healthchecks-wrapper"
}