{ "info": { "author": "Evstifeev Roman", "author_email": "someuniquename@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: Android", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Topic :: Software Development" ], "description": "Websubsub\n=========\n\n|Build Status| |codecov| |Support Python versions 3.6 and 3.7|\n|pypi-version|\n\nDjango websub subscriber.\n\nInstallation\n------------\n\n::\n\n pip install websubsub\n\nAdd ``websubsub.apps.WebsubsubConfig`` to the list of ``INSTALLED_APPS``\nin your ``settings.py``:\n\n::\n\n INSTALLED_APPS = [\n ...,\n 'websubsub.apps.WebsubsubConfig'\n ]\n\nSet the ``SITE_URL`` setting in your ``settings.py`` to the full url of\nyour project site, e.g. ``https://example.com``. It will be used to\nbuild full callback urls.\n\nSet ``DUMBLOCK_REDIS_URL`` settings in your ``settings.py``. Redis locks\nare used to ensure subscription/unsubscription tasks are consistent with\nhub and local database.\n\n::\n\n SITE_URL = 'http://example.com'\n DUMBLOCK_REDIS_URL= 'redis://redishost:6379'\n\nAdd ``websubsub.tasks.refresh_subscriptions`` and\n``websubsub.tasks.retry_failed`` to celerybeat schedule. If you define\nit in ``settings.py``:\n\n::\n\n CELERY_BEAT_SCHEDULE = {\n 'websub_refresh': {\n 'task': 'websubsub.tasks.refresh_subscriptions',\n 'schedule': 3600 # Hourly\n },\n 'websub_retry': {\n 'task': 'websubsub.tasks.retry_failed',\n 'schedule': 600 # Every 10 minutes\n },\n }\n\nUsage\n-----\n\nCreate Websub callback\n~~~~~~~~~~~~~~~~~~~~~~\n\nCreate celery task handler, usually in ``tasks.py``:\n\n::\n\n from celery import shared_task\n\n @shared_task\n def news_task(data):\n print('got news!')\n\nCallback url should end with uuid. Register url for handler in\n``urls.py``:\n\n::\n\n from websubsub.views import WssView\n from .tasks import news_task, reports_task\n\n urlpatterns = [\n path('/websubcallback/news/', WssView.as_view(news_task), name='webnews')\n path('/websubcallback/reports/', WssView.as_view(reports_task), name='webreports')\n ]\n\nSubscribe\n~~~~~~~~~\n\nYou can create subscription on the go, or use static subscriptions.\n\nTo create subscription in the code:\n\n::\n\n from websubsub.models import Subscription\n Subscription.create(topic='mytopic', urlname='webnews', hub='http://example.com')\n\nThis will create Subscription object in the database and schedule celery\ntask to subscribe with hub.\n\nStatic subscriptions\n^^^^^^^^^^^^^^^^^^^^\n\n[TODO] Not sure it is the best way to handle static subscriptions.\n\nStatic subscriptions can be defined in your ``settings.py``, they are\nthen materialized with management command\n``./manage.py websubscribe_static``.\n\nAdd static subscriptions in your ``settings.py``:\n\n::\n\n WEBSUBS_HUBS = {\n 'http://example.com': {\n 'subscriptions': [\n # (topic, urlname) pairs\n ('mytopic', 'webnews'),\n ...\n ]\n }\n }\n\nExecute ``./manage.py websubscribe_static``\n\nUnsubscribe\n~~~~~~~~~~~\n\nTo unsubscribe existing subscription, call\n``Subscription.unsubscribe()`` method:\n\n::\n\n from websubsub.models import Subscription\n Subscription.objects.get(pk=4).unsubscribe()\n\nDiscovery\n---------\n\nNot implemented\n\nSettings\n--------\n\n``SITE_URL`` - ex.: ``https://example.com``. Required. Will be used to\nbuild full callback urls.\n\n``DUMBLOCK_REDIS_URL`` - ex.: ``redis://redishost:6379``. Required. Will\nbe used to lock atomic tasks.\n\n``WEBSUBS_DEFAULT_HUB_URL``\n\n``WEBSUBS_MAX_CONNECT_RETRIES``\n\n``WEBSUBS_MAX_HUB_ERROR_RETRIES``\n\n``WEBSUBS_MAX_VERIFY_RETRIES``\n\n``WEBSUBS_VERIFY_WAIT_TIME`` - How many seconds should pass before\nunverified subscription is considered failed. After that time,\n``websubsub.tasks.retry_failed()`` task will be able to retry\nsubscription process again.\n\nTesting\n-------\n\n::\n\n pip install -r tests/requirements.txt\n py.test\n\n.. |Build Status| image:: https://travis-ci.org/Fak3/websubsub.svg?branch=master\n :target: https://travis-ci.org/Fak3/websubsub\n.. |codecov| image:: https://codecov.io/gh/Fak3/websubsub/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/Fak3/websubsub\n.. |Support Python versions 3.6 and 3.7| image:: https://img.shields.io/badge/python-3.6%2C%203.7-blue.svg\n.. |pypi-version| image:: https://img.shields.io/pypi/v/websubsub.svg\n :target: https://pypi.python.org/pypi/websubsub\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Fak3/websubsub", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "websubsub", "package_url": "https://pypi.org/project/websubsub/", "platform": "", "project_url": "https://pypi.org/project/websubsub/", "project_urls": { "Homepage": "https://github.com/Fak3/websubsub" }, "release_url": "https://pypi.org/project/websubsub/0.6/", "requires_dist": [ "celery", "django", "django-rest-framework", "dumblock", "redis", "requests", "nose; extra == 'develop'", "responses; extra == 'develop'" ], "requires_python": ">=3.6", "summary": "Django websub subscriber", "version": "0.6" }, "last_serial": 3760961, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "028b31015fa9ba2f19fea9c0be3b3825", "sha256": "e219cd91048aaca8e1ab341e2687a3da1ac22c2a01c85c3222bc169f6023bc7f" }, "downloads": -1, "filename": "websubsub-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "028b31015fa9ba2f19fea9c0be3b3825", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 13551, "upload_time": "2018-02-12T18:08:50", "url": "https://files.pythonhosted.org/packages/02/5e/47ca75bdb50351d81fc1d984588bf16a0fd71e9a6d49067e2e478a292024/websubsub-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37a60e8bc63bfc5b16042651e179394b", "sha256": "51cfe831599891dc19863d36818731e1cac7ab78eba5861f6c530dab141d3ccd" }, "downloads": -1, "filename": "websubsub-0.3.tar.gz", "has_sig": false, "md5_digest": "37a60e8bc63bfc5b16042651e179394b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9626, "upload_time": "2018-02-12T18:08:52", "url": "https://files.pythonhosted.org/packages/85/f5/24224e2f5525587ae532e8cdc8ce8534cc68be1acd544682f26a8b3b005a/websubsub-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "ae71a258895ed8ebd89829cfd0191cd8", "sha256": "578ce527e6e6effd66091ef88bf9c23e00817dac041848ae1c13e5bfc086c569" }, "downloads": -1, "filename": "websubsub-0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "ae71a258895ed8ebd89829cfd0191cd8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 15299, "upload_time": "2018-02-14T13:47:08", "url": "https://files.pythonhosted.org/packages/7a/ad/cf04d58fb959d1a5800fdccc52998e58d911e0a184f0e82abeda30dceece/websubsub-0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fb7cb01d1d6214f1aa82742fb61b7910", "sha256": "536d73a08bad9d3889e4edc4df6ef58824c0ad1afa6bddfb8268d462e58f9bf1" }, "downloads": -1, "filename": "websubsub-0.4.tar.gz", "has_sig": false, "md5_digest": "fb7cb01d1d6214f1aa82742fb61b7910", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10286, "upload_time": "2018-02-14T13:47:10", "url": "https://files.pythonhosted.org/packages/52/d2/1a6eff5f582e4c6b9d89621f4d5de7a7c9d6de64bdd8d57bcb33ecfd454f/websubsub-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "ee39afd2e8cd3dbfcec1ea769abe26fa", "sha256": "f58176e5c24143c131201461fba8bb4ce240bc659317b8d04164fc731474d6f2" }, "downloads": -1, "filename": "websubsub-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "ee39afd2e8cd3dbfcec1ea769abe26fa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18011, "upload_time": "2018-04-12T17:26:32", "url": "https://files.pythonhosted.org/packages/29/83/074fe15dbc3caf96efb1b8717c5eae2d541d9d866c205bb76279d8630841/websubsub-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8a0c628b33c0dd37d0191dcbfbd88e14", "sha256": "d15d17fbaefc5d110b1ebb094aeef18fbf2ab424febbb540578f74af6fe46f01" }, "downloads": -1, "filename": "websubsub-0.5.tar.gz", "has_sig": false, "md5_digest": "8a0c628b33c0dd37d0191dcbfbd88e14", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 12503, "upload_time": "2018-04-12T17:26:33", "url": "https://files.pythonhosted.org/packages/63/31/6a6cd821f0b8e3747feed78a1ecf05f7eb7c35743c1b2aca94f02880a83f/websubsub-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "c33fa8f7d6c2523c0fecde9a901bd060", "sha256": "3d31047a0b1a12aa48117fa923ff097ff8c89521aa24d3440397aa0774defbbd" }, "downloads": -1, "filename": "websubsub-0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "c33fa8f7d6c2523c0fecde9a901bd060", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18673, "upload_time": "2018-04-13T07:41:54", "url": "https://files.pythonhosted.org/packages/29/ed/ca767813168cfaa686812acaeb37b354587f2075227edb726e664a46883f/websubsub-0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6489f8c5b398b7934fa833807f8226d", "sha256": "9fa068936c7bb9080fdffe6d885a2820e1c58f08828a1f3c334003e9976a823c" }, "downloads": -1, "filename": "websubsub-0.6.tar.gz", "has_sig": false, "md5_digest": "b6489f8c5b398b7934fa833807f8226d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 12693, "upload_time": "2018-04-13T07:41:55", "url": "https://files.pythonhosted.org/packages/9a/aa/ca09adc98a8520cc663123df168a08bea08eb3b27e307379569d518ba8fa/websubsub-0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c33fa8f7d6c2523c0fecde9a901bd060", "sha256": "3d31047a0b1a12aa48117fa923ff097ff8c89521aa24d3440397aa0774defbbd" }, "downloads": -1, "filename": "websubsub-0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "c33fa8f7d6c2523c0fecde9a901bd060", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18673, "upload_time": "2018-04-13T07:41:54", "url": "https://files.pythonhosted.org/packages/29/ed/ca767813168cfaa686812acaeb37b354587f2075227edb726e664a46883f/websubsub-0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6489f8c5b398b7934fa833807f8226d", "sha256": "9fa068936c7bb9080fdffe6d885a2820e1c58f08828a1f3c334003e9976a823c" }, "downloads": -1, "filename": "websubsub-0.6.tar.gz", "has_sig": false, "md5_digest": "b6489f8c5b398b7934fa833807f8226d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 12693, "upload_time": "2018-04-13T07:41:55", "url": "https://files.pythonhosted.org/packages/9a/aa/ca09adc98a8520cc663123df168a08bea08eb3b27e307379569d518ba8fa/websubsub-0.6.tar.gz" } ] }