{ "info": { "author": "Kenta Onishi", "author_email": "ohke.develop@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# sqs-polling\n`sqs-polling` is simple AWS SQS daemon. The following is all.\n- Polls SQS at regular intervals.\n- Receives messages and executes your callback.\n- If your callback function returns True, deletes the message.\n\n## Installation\n```\n$ pip install sqs-polling\n```\n\n## Usage\nThe key function is `sqs_polling`, please check its interface.\n\nThe simplest usage is below.\n```python\nfrom sqs_polling import sqs_polling\n\n\ndef your_callback(message, greeting):\n print(greeting + message[\"name\"])\n return True\n\n\nyour_queue_url=\"https://sqs.your-region.amazonaws.com/XXXXXXXXXXXX/your-sqs\",\nsqs_polling(queue_url=your_queue_url, callback=your_callback, callback_args={\"greeting\": \"Hello, \"})\n```\n\n### Callback\nYour callback function must return 1 bool value.\nIf True, deletes the processed message.\nIf False, the message is remaining in your SQS and reprocessed after `visibility_timeout` seconds. It is recommended to return False if message processing fails.\n\n## Configuration\n\n### AWS account profile\nIn the example above, explicit AWS account profiles is omitted.\n\nIf explicit authentication is required, you can access SQS by setting additional profiles in `aws_profile_dict` argument.\n\n```python\nyour_aws_profile = {\n \"region_name\": \"your-region\",\n \"aws_access_key_id\": \"XXXXXXXXXXXXXXXXXXXX\",\n \"aws_secret_access_key\": \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\",\n}\n\nsqs_polling(queue_url=your_queue_url, callback=your_callback, aws_profile_dict=your_aws_profile)\n```\n\n### Polling\nThe arguments related to polling settings are as follows.\n\n- `extract_body`: Whether to extract the message body. (default: True)\n - The `body` here refers to `$.Messages.Body` JSON element of SQS messages.\n- `interval_seconds`: Message reception interval seconds. (default: 1.0)\n- `visibility_timeout`: Message visibility timeout seconds. (default: 300)\n\n### Concurrency\n`sqs-polling` can process messages in parallel using threads or processes. It can be controlled by the following arguments.\n\n- `max_workers`: Max number of concurrent threads or processes. (default: 1)\n- `process_worker`: If this is True, processes is used instead of threads. (default: False) \n\n```python\n# Parallel processing with up to 64 threads.\nsqs_polling(queue_url=your_queue_url, callback=your_callback, max_workers=64)\n\n# Parallel processing with up to 4 processes.\nsqs_polling(queue_url=your_queue_url, callback=your_callback, process_worker=True, max_workers=4)\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/ohke/sqs-polling", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "sqs-polling", "package_url": "https://pypi.org/project/sqs-polling/", "platform": "", "project_url": "https://pypi.org/project/sqs-polling/", "project_urls": { "Homepage": "https://github.com/ohke/sqs-polling" }, "release_url": "https://pypi.org/project/sqs-polling/0.1.0/", "requires_dist": [ "boto3" ], "requires_python": "~=3.5", "summary": "Polls AWS SQS messages and executes your callback.", "version": "0.1.0", "yanked": false, "yanked_reason": null }, "last_serial": 6023339, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "812e8174565e4ae94773bd17946a26fa", "sha256": "9855305d92520aa283abc62d909a8bd45473e18db12b242db4d1686a25628841" }, "downloads": -1, "filename": "sqs_polling-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "812e8174565e4ae94773bd17946a26fa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 5670, "upload_time": "2019-10-24T11:55:12", "upload_time_iso_8601": "2019-10-24T11:55:12.465346Z", "url": "https://files.pythonhosted.org/packages/4c/15/b31ad964a85fb88a0a26d388dae5585eb8c1f12e227f28286b17c03aca1b/sqs_polling-0.1.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "1ad3ab1cb0e7d01941bd4357e24d8e22", "sha256": "0c3c6f40255fc3d1a94e51b736ffc50f669db72d0e1ec9f5feba1cee2cae2985" }, "downloads": -1, "filename": "sqs-polling-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1ad3ab1cb0e7d01941bd4357e24d8e22", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 4811, "upload_time": "2019-10-24T11:55:14", "upload_time_iso_8601": "2019-10-24T11:55:14.074659Z", "url": "https://files.pythonhosted.org/packages/78/c1/dcefd372e9df04c69f53ace45f0a7746b01a0b39278d4cfadd8bafa26f72/sqs-polling-0.1.0.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "812e8174565e4ae94773bd17946a26fa", "sha256": "9855305d92520aa283abc62d909a8bd45473e18db12b242db4d1686a25628841" }, "downloads": -1, "filename": "sqs_polling-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "812e8174565e4ae94773bd17946a26fa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.5", "size": 5670, "upload_time": "2019-10-24T11:55:12", "upload_time_iso_8601": "2019-10-24T11:55:12.465346Z", "url": "https://files.pythonhosted.org/packages/4c/15/b31ad964a85fb88a0a26d388dae5585eb8c1f12e227f28286b17c03aca1b/sqs_polling-0.1.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "1ad3ab1cb0e7d01941bd4357e24d8e22", "sha256": "0c3c6f40255fc3d1a94e51b736ffc50f669db72d0e1ec9f5feba1cee2cae2985" }, "downloads": -1, "filename": "sqs-polling-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1ad3ab1cb0e7d01941bd4357e24d8e22", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.5", "size": 4811, "upload_time": "2019-10-24T11:55:14", "upload_time_iso_8601": "2019-10-24T11:55:14.074659Z", "url": "https://files.pythonhosted.org/packages/78/c1/dcefd372e9df04c69f53ace45f0a7746b01a0b39278d4cfadd8bafa26f72/sqs-polling-0.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }