Name | py-sentry JSON |
Version |
1.6.0
JSON |
| download |
home_page | |
Summary | Provides a foundation for a service that will run an action a regular intervals. |
upload_time | 2024-01-19 21:54:55 |
maintainer | |
docs_url | None |
author | |
requires_python | <4,>=3.10 |
license | BSD-3-Clause-LBNL |
keywords |
service
daemon
signals
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[py-sentry](https://gitlab.com/nest.lbl.gov/py-sentry) contains the python package that provides a foundation for a micro-service that can either be run once or at a regular interval.
This document outlines how this project can be used. The purpose of this project is described [elsewhere](raison_d_ĂȘtre.md), as are the [details](details.md)
# Foundational Elements
## The `IntervalService`
A standard `py_sentry` executable take the following as demonstrated by the `command_service.py` example:
"""
This shows how to create an executeable to run a Task using the
sentry.service module.
"""
from sentry import IntervalService
def main() -> int:
"""
Runs the command_task as a sentry.
"""
service = IntervalService("command_task")
return service.run()
if __name__ == "__main__":
main()
The `IntervalService` is designed to execute a named Task. The task itself is declared as a [Python entry point](https://packaging.python.org/en/latest/specifications/entry-points/). When using a [`pyproject.toml` file](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/) for packaging the task can be declared as follows:
[project.entry-points.sentry]
command_task = "sentry.command_task:CommandTask"
## A `Task`
A `Task` is a python class that provide the implementation the behaviour of a micro-service as managed by an `IntervalService`. The complete information about how a `Task` does this is provided [elsewhere](task.md)
The main concept is that a minimal task must implement the following function:
def __init__(self) -> None:
"""
Creates an instance of this class.
"""
and in most other cases, also implement this other function:
def execute(self) -> None:
"""
Executes the responsibilities of this executable
"""
Raw data
{
"_id": null,
"home_page": "",
"name": "py-sentry",
"maintainer": "",
"docs_url": null,
"requires_python": "<4,>=3.10",
"maintainer_email": "",
"keywords": "service,daemon,signals",
"author": "",
"author_email": "Simon Patton <sjpatton@lbl.gov>",
"download_url": "https://files.pythonhosted.org/packages/70/95/110dba9308971873b0a09ff7c254bbb966c90de8e8793dd2bc731bdfb99e/py_sentry-1.6.0.tar.gz",
"platform": null,
"description": "[py-sentry](https://gitlab.com/nest.lbl.gov/py-sentry) contains the python package that provides a foundation for a micro-service that can either be run once or at a regular interval.\n\nThis document outlines how this project can be used. The purpose of this project is described [elsewhere](raison_d_\u00eatre.md), as are the [details](details.md)\n\n# Foundational Elements\n\n## The `IntervalService`\n\nA standard `py_sentry` executable take the following as demonstrated by the `command_service.py` example:\n\n \"\"\"\n This shows how to create an executeable to run a Task using the\n sentry.service module.\n \"\"\"\n \n from sentry import IntervalService\n \n \n def main() -> int:\n \"\"\"\n Runs the command_task as a sentry.\n \"\"\"\n service = IntervalService(\"command_task\")\n return service.run()\n \n \n if __name__ == \"__main__\":\n main()\n\nThe `IntervalService` is designed to execute a named Task. The task itself is declared as a [Python entry point](https://packaging.python.org/en/latest/specifications/entry-points/). When using a [`pyproject.toml` file](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/) for packaging the task can be declared as follows:\n\n [project.entry-points.sentry]\n command_task = \"sentry.command_task:CommandTask\"\n\n## A `Task`\n\nA `Task` is a python class that provide the implementation the behaviour of a micro-service as managed by an `IntervalService`. The complete information about how a `Task` does this is provided [elsewhere](task.md)\n\nThe main concept is that a minimal task must implement the following function:\n\n def __init__(self) -> None:\n \"\"\"\n Creates an instance of this class.\n \"\"\"\n\nand in most other cases, also implement this other function:\n\n def execute(self) -> None:\n \"\"\"\n Executes the responsibilities of this executable\n \"\"\"\n\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause-LBNL",
"summary": "Provides a foundation for a service that will run an action a regular intervals.",
"version": "1.6.0",
"project_urls": null,
"split_keywords": [
"service",
"daemon",
"signals"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "07656bfc1411ad0dc2d5ee8c789561b134ce40687ad36880ac7a9f3f6c04a2cf",
"md5": "5288b211723cc0a269bfe8729c7c50a2",
"sha256": "f842690ecfbc28b116b843590a57967c7283eac4cafaa310c79cd4a979c67b58"
},
"downloads": -1,
"filename": "py_sentry-1.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5288b211723cc0a269bfe8729c7c50a2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.10",
"size": 18604,
"upload_time": "2024-01-19T21:54:53",
"upload_time_iso_8601": "2024-01-19T21:54:53.467210Z",
"url": "https://files.pythonhosted.org/packages/07/65/6bfc1411ad0dc2d5ee8c789561b134ce40687ad36880ac7a9f3f6c04a2cf/py_sentry-1.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7095110dba9308971873b0a09ff7c254bbb966c90de8e8793dd2bc731bdfb99e",
"md5": "c27076a6edaee1605a2745730fdac4fa",
"sha256": "2b9a759f581c7490678ae409a299968cd1e4c56c17ed02893d01f9bca7fd8cb0"
},
"downloads": -1,
"filename": "py_sentry-1.6.0.tar.gz",
"has_sig": false,
"md5_digest": "c27076a6edaee1605a2745730fdac4fa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.10",
"size": 12094,
"upload_time": "2024-01-19T21:54:55",
"upload_time_iso_8601": "2024-01-19T21:54:55.075823Z",
"url": "https://files.pythonhosted.org/packages/70/95/110dba9308971873b0a09ff7c254bbb966c90de8e8793dd2bc731bdfb99e/py_sentry-1.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-19 21:54:55",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "py-sentry"
}