# prefect_supporter
prefect_supporter provide services to supporter to manage Prefect
## Usage
1. Delete `flow run` history in Database. It also deletes `task run`
- create your deployment
- example
```python
from datetime import datetime, timedelta
from prefect.settings import PREFECT_API_URL
from prefect.deployments import Deployment
from prefect.server.schemas.schedules import CronSchedule
from prefect.server.schemas.states import StateType
from prefect_supporter.flow import clear_db_history
from prefect_supporter.flow.clear_db_history import clear_db_history_flow
from prefect_supporter.model.clearing_db import FlowRunClearing
Deployment.build_from_flow(
flow=clear_db_history_flow,
name="clear_db_history_deployment",
schedule=CronSchedule(cron="0 * * * *", ),
work_queue_name="default",
tags=["prefect-management"],
entrypoint=f"{clear_db_history.__file__}:clear_db_history_flow",
parameters={
"frc": FlowRunClearing(
api_url=PREFECT_API_URL.value(),
state_list=[StateType.COMPLETED],
before_dt=(datetime.now() - timedelta(days=7)),
after_dt=datetime(year=1970, month=1, day=1, hour=0, minute=0)
)
},
apply=True
)
```
- Parameter
- `FlowRunClearing` model
- api_url : your prefect api address, ex) http://localhost:4200/api
- state_list: state list to delete ex) "COMPLETED", "FAILED"
- before_dt : time range to delete data to be started
- after_dt : time range to delete data to be ended
Raw data
{
"_id": null,
"home_page": "https://github.com/ultimatelife/prefect-supporter",
"name": "prefect-supporter",
"maintainer": "Kunizno",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "pykunzino@gmail.com",
"keywords": "prefect,prefect-supporter",
"author": "Kunizno",
"author_email": "pykunzino@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/5d/0e/b1e98ef7e5ee00884ae07fc33fad6f6f4b4247fd01f5d253ef9f94beff20/prefect_supporter-1.0.4.tar.gz",
"platform": null,
"description": "# prefect_supporter\n\nprefect_supporter provide services to supporter to manage Prefect\n\n## Usage\n\n1. Delete `flow run` history in Database. It also deletes `task run`\n - create your deployment\n - example \n ```python\n \n from datetime import datetime, timedelta\n \n from prefect.settings import PREFECT_API_URL\n from prefect.deployments import Deployment\n from prefect.server.schemas.schedules import CronSchedule\n from prefect.server.schemas.states import StateType\n from prefect_supporter.flow import clear_db_history\n from prefect_supporter.flow.clear_db_history import clear_db_history_flow\n from prefect_supporter.model.clearing_db import FlowRunClearing\n \n Deployment.build_from_flow(\n flow=clear_db_history_flow,\n name=\"clear_db_history_deployment\",\n schedule=CronSchedule(cron=\"0 * * * *\", ),\n work_queue_name=\"default\",\n tags=[\"prefect-management\"],\n entrypoint=f\"{clear_db_history.__file__}:clear_db_history_flow\",\n parameters={\n \"frc\": FlowRunClearing(\n api_url=PREFECT_API_URL.value(),\n state_list=[StateType.COMPLETED],\n before_dt=(datetime.now() - timedelta(days=7)),\n after_dt=datetime(year=1970, month=1, day=1, hour=0, minute=0)\n )\n },\n apply=True\n )\n ```\n \n - Parameter \n - `FlowRunClearing` model\n - api_url : your prefect api address, ex) http://localhost:4200/api\n - state_list: state list to delete ex) \"COMPLETED\", \"FAILED\"\n - before_dt : time range to delete data to be started\n - after_dt : time range to delete data to be ended",
"bugtrack_url": null,
"license": "MIT",
"summary": "Prefect Supporter",
"version": "1.0.4",
"project_urls": {
"Homepage": "https://github.com/ultimatelife/prefect-supporter",
"Repository": "https://github.com/ultimatelife/prefect-supporter"
},
"split_keywords": [
"prefect",
"prefect-supporter"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cc8db79e00ae833f7714987959c6c2165093bf4d65b05e2b19ab5e5d15a9ac29",
"md5": "9ecd3634fc50366e0ab83ec795b52464",
"sha256": "29417eb746a4f58aabc5dac21b0afe5edf123164b7f998f9f23b8018289c3578"
},
"downloads": -1,
"filename": "prefect_supporter-1.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9ecd3634fc50366e0ab83ec795b52464",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 3533,
"upload_time": "2024-02-29T08:52:31",
"upload_time_iso_8601": "2024-02-29T08:52:31.502548Z",
"url": "https://files.pythonhosted.org/packages/cc/8d/b79e00ae833f7714987959c6c2165093bf4d65b05e2b19ab5e5d15a9ac29/prefect_supporter-1.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5d0eb1e98ef7e5ee00884ae07fc33fad6f6f4b4247fd01f5d253ef9f94beff20",
"md5": "f747a53f22f070eaa9120938c0d071a6",
"sha256": "477a2355c3edddc9e64abbb700c29e54a9600ec507d125f90cbce8fb420ab75e"
},
"downloads": -1,
"filename": "prefect_supporter-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "f747a53f22f070eaa9120938c0d071a6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 3579,
"upload_time": "2024-02-29T08:52:32",
"upload_time_iso_8601": "2024-02-29T08:52:32.738551Z",
"url": "https://files.pythonhosted.org/packages/5d/0e/b1e98ef7e5ee00884ae07fc33fad6f6f4b4247fd01f5d253ef9f94beff20/prefect_supporter-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-29 08:52:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ultimatelife",
"github_project": "prefect-supporter",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "prefect-supporter"
}