{"id":29939997,"url":"https://github.com/pyprogrammerblog/arend","last_synced_at":"2025-08-03T00:43:44.420Z","repository":{"id":43115372,"uuid":"367458363","full_name":"pyprogrammerblog/arend","owner":"pyprogrammerblog","description":"A simple producer consumer library for Beanstalkd queue.","archived":false,"fork":false,"pushed_at":"2022-10-02T13:57:45.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T12:19:13.249Z","etag":null,"topics":["beanstalkd","beanstalkd-monitor","fastapi","producer-consumer","rabbitmq","redis","sqlmodel"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyprogrammerblog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-14T19:13:54.000Z","updated_at":"2022-09-02T16:36:33.000Z","dependencies_parsed_at":"2022-08-19T09:01:29.155Z","dependency_job_id":null,"html_url":"https://github.com/pyprogrammerblog/arend","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pyprogrammerblog/arend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyprogrammerblog%2Farend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyprogrammerblog%2Farend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyprogrammerblog%2Farend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyprogrammerblog%2Farend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyprogrammerblog","download_url":"https://codeload.github.com/pyprogrammerblog/arend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyprogrammerblog%2Farend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268230337,"owners_count":24217022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beanstalkd","beanstalkd-monitor","fastapi","producer-consumer","rabbitmq","redis","sqlmodel"],"created_at":"2025-08-03T00:43:39.097Z","updated_at":"2025-08-03T00:43:44.393Z","avatar_url":"https://github.com/pyprogrammerblog.png","language":"Python","readme":"Arend\n========\n\nA simple producer-consumer library for the Beanstalkd queue.\n\nInstallation\n--------------\nHit the command:\n```shell\npip install arend\n```\n\nBasic Usage\n--------------\n\nIn your code:\n ```python\nfrom arend import arend_task\nfrom arend.backends.mongo import MongoSettings\nfrom arend.brokers import BeanstalkdSettings\nfrom arend.settings import ArendSettings\nfrom arend.worker import consumer\n\nsettings = ArendSettings(\n    beanstalkd=BeanstalkdSettings(host=\"beanstalkd\", port=11300),\n    backend=MongoSettings(\n        mongo_connection=\"mongodb://user:pass@mongo:27017\",\n        mongo_db=\"db\",\n        mongo_collection=\"Tasks\"\n    ),\n)\n\n@arend_task(queue=\"my_queue\", settings=settings)\ndef double(num: int):\n    return 2 * num\n\ndouble(2)  # returns 4\ntask = double.apply_async(args=(4,))  # It is sent to the queue\n\nconsumer(queue=\"my_queue\", settings=settings)  # consume tasks from the queue\n\nTask = settings.get_backend()  # you can check your backend for the result\ntask = Task.get(uuid=task.uuid)\nassert task.result == 4\n```\n\nBackends\n-------------------\nThe available backends to store logs are **Mongo** and **Redis**.\nPlease read the [docs](https://arend.readthedocs.io/en/latest/) \nfor further information.\n\nSetting your backend with environment variables\n--------------------------------------------------\nYou can set your backend by defining env vars.\nThe `AREND__` prefix indicates that it belongs to the Arend.\n```shell\n# Redis\nAREND__REDIS_HOST='redis'\nAREND__REDIS_DB='1'\nAREND__REDIS_PASSWORD='pass'\n...\n\n# Mongo\nAREND__MONGO_CONNECTION='mongodb://user:pass@mongo:27017'\nAREND__MONGO_DB='db'\nAREND__MONGO_COLLECTION='logs'\n...\n```\n\nIn your code:\n ```python\nfrom arend import arend_task\nfrom arend.worker import consumer\n\n\n@arend_task(queue=\"my_queue\")\ndef double(num: int):\n    return 2 * num\n\ndouble.apply_async(args=(4,))  # It is sent to the queue\n\nconsumer(queue=\"my_queue\")\n```\n\nDocumentation\n--------------\n\nPlease visit this [link](https://arend.readthedocs.io/en/latest/) for documentation.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyprogrammerblog%2Farend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyprogrammerblog%2Farend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyprogrammerblog%2Farend/lists"}