{ "info": { "author": "Paul McLanahan", "author_email": "paul@mclanahan.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: System :: Systems Administration" ], "description": "=======\nURLWait\n=======\n\n.. image:: https://img.shields.io/travis/pmclanahan/urlwait.svg\n :target: https://travis-ci.org/pmclanahan/urlwait/\n.. image:: https://img.shields.io/pypi/v/urlwait.svg\n :target: https://pypi.python.org/pypi/urlwait\n\nI needed a way to block my app from starting until the database service was running and\naccepting connections. This was particularly a problem when using Docker and docker-compose.\nYou can run this utility as part of a ``run-dev.sh`` or ``run-tests.sh`` script and it will\nblock for 15 seconds (configurable) until it can connect to the hostname and port as specified\nin your connection URL (gleaned from DATABASE_URL environment variable by default).\n\nInstallation\n============\n\n::\n\n $ pip install urlwait\n\nUsage\n=====\n\n::\n\n $ urlwait --help\n\n Usage:\n\n $ urlwait [SERVICE URL] [TIMEOUT]\n\n SERVICE URL is a connection url, e.g. a typical value for $DATABASE_URL. TIMEOUT is\n a number of seconds to try to connect to the host and port specified in the SERVICE\n URL. These values may also be specified in environment variables, but command line\n args take precedence:\n\n URLWAIT_VARNAME: the env var name containing the URL to check. Default DATABASE_URL.\n URLWAIT_TIMEOUT: the number of seconds to wait. Default 15.\n\n Returns a 0 status if the connection completed successfully before the timeout, or 1 if not.\n It is designed for use with Docker or other dev or testing environments where the connected\n services and the app are started simultaneously, but one should wait for the other.\n\n Examples:\n\n The following are equivalent:\n\n $ urlwait redis://localhost:6379/0 20\n $ urlwait $CACHE_URL 20\n $ URLWAIT_VARNAME=CACHE_URL URLWAIT_TIMEOUT=20 urlwait\n\nThe module is also usable in your python code::\n\n import os\n\n from urlwait import wait_for_url\n\n\n if wait_for_url(os.getenv('REDIS_URL')):\n # do things with the service\n else:\n # service likely did not start\n\nIf you don't have the service URL but do have the host and port, you can use the\n``wait_for_service(host, port, timeout)`` function instead.\n\n\nChangelog\n=========\n\n* 0.4 - 2017-03-02 - Always return true if protocol is sqlite", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pmclanahan/urlwait", "keywords": "database_url,tcp,port,docker,service,deploy,deployment", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "urlwait", "package_url": "https://pypi.org/project/urlwait/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/urlwait/", "project_urls": { "Homepage": "https://github.com/pmclanahan/urlwait" }, "release_url": "https://pypi.org/project/urlwait/0.4/", "requires_dist": null, "requires_python": "", "summary": "A CLI utility for blocking until a service is listening", "version": "0.4" }, "last_serial": 2679006, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "23e42824ef732e3203ff02bb7e2cddd5", "sha256": "87ca9f7b7f787716cdeecf04d5845e6877ebd8980adc6f75ab743281acf1f1f3" }, "downloads": -1, "filename": "urlwait-0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "23e42824ef732e3203ff02bb7e2cddd5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5179, "upload_time": "2016-02-08T21:44:46", "url": "https://files.pythonhosted.org/packages/f4/6e/66e2c459ffb5f56f1c951d3534c0a4788ba9d336fa76f0d9fefda8ad71f6/urlwait-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "93c7a8ddb5636ff896235d999300cd30", "sha256": "091f34c77da3aed4a3d56403c59c5f5cf2486b36169fb5af61aa26a2306282b4" }, "downloads": -1, "filename": "urlwait-0.1.tar.gz", "has_sig": true, "md5_digest": "93c7a8ddb5636ff896235d999300cd30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3546, "upload_time": "2016-02-08T21:44:53", "url": "https://files.pythonhosted.org/packages/89/a3/baba11ac68a86f933e0bf55f4f44926a3374f06a303f41704690bcc219d6/urlwait-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "702ceada5cc718277258fd639b723611", "sha256": "457ed836a975e57ba2f101e21504a00da2d99cfee99e674ed2ccb3e00e396260" }, "downloads": -1, "filename": "urlwait-0.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "702ceada5cc718277258fd639b723611", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5584, "upload_time": "2016-02-08T22:09:04", "url": "https://files.pythonhosted.org/packages/58/ff/d5f88efe54f45857a1a2489862e5de2e41a16d0cfd0c3e523ae9f435820e/urlwait-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "47a18e5565dbec719971f6dc197df718", "sha256": "c5c56caf8192fc77881f5142322d62804b2b808251891fbc8126d453766df689" }, "downloads": -1, "filename": "urlwait-0.2.tar.gz", "has_sig": true, "md5_digest": "47a18e5565dbec719971f6dc197df718", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3777, "upload_time": "2016-02-08T22:09:18", "url": "https://files.pythonhosted.org/packages/45/f1/5f908c0045bedc599660c6b853a0dea2c6652ef9e198a923094a8c05a127/urlwait-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "3696407b16059ca773875c0d41df88fc", "sha256": "2b1fb4e5085344f91f1aaaa3c1809e44d100691b20c2431cb81af1824d82939c" }, "downloads": -1, "filename": "urlwait-0.3-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "3696407b16059ca773875c0d41df88fc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5959, "upload_time": "2016-02-09T19:13:20", "url": "https://files.pythonhosted.org/packages/84/f8/5ebde84e8b818ab35641fe16f48a70c6e442a441aa3708f271af6d704d45/urlwait-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "229f0abd8f48543faae118d944a7ca5e", "sha256": "54eb1cc8346f24fd906d379447b49c25a19af220cf7be35c8bac136ee8f09105" }, "downloads": -1, "filename": "urlwait-0.3.tar.gz", "has_sig": true, "md5_digest": "229f0abd8f48543faae118d944a7ca5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4695, "upload_time": "2016-02-09T19:13:27", "url": "https://files.pythonhosted.org/packages/54/7a/d35c26355789a64e7e2214da3640436f5386e3612465318372ac3a3c5200/urlwait-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "d8248fcd916814836d91e24168bd659c", "sha256": "fc39ff2c8abbcaad5043e1f79699dcb15a036cc4b0ff4d1aa825ea105d4889ff" }, "downloads": -1, "filename": "urlwait-0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d8248fcd916814836d91e24168bd659c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6261, "upload_time": "2017-03-02T20:55:09", "url": "https://files.pythonhosted.org/packages/e6/41/e5666e076e5a89b88f47d9c511fbe829b34150a607a185d974026f4ed4b1/urlwait-0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "416724cd7c96937b098c1cf127be3276", "sha256": "395fc0c2a7f9736858a2c2f449aa20c6e9da1f86bfc2d1fda4f2f5b78a5c115a" }, "downloads": -1, "filename": "urlwait-0.4.tar.gz", "has_sig": false, "md5_digest": "416724cd7c96937b098c1cf127be3276", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4883, "upload_time": "2017-03-02T20:55:11", "url": "https://files.pythonhosted.org/packages/9a/cd/74d33204d67170e113a5262b2615c549568b5fddbd3a37fba9d2156e6179/urlwait-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d8248fcd916814836d91e24168bd659c", "sha256": "fc39ff2c8abbcaad5043e1f79699dcb15a036cc4b0ff4d1aa825ea105d4889ff" }, "downloads": -1, "filename": "urlwait-0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d8248fcd916814836d91e24168bd659c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6261, "upload_time": "2017-03-02T20:55:09", "url": "https://files.pythonhosted.org/packages/e6/41/e5666e076e5a89b88f47d9c511fbe829b34150a607a185d974026f4ed4b1/urlwait-0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "416724cd7c96937b098c1cf127be3276", "sha256": "395fc0c2a7f9736858a2c2f449aa20c6e9da1f86bfc2d1fda4f2f5b78a5c115a" }, "downloads": -1, "filename": "urlwait-0.4.tar.gz", "has_sig": false, "md5_digest": "416724cd7c96937b098c1cf127be3276", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4883, "upload_time": "2017-03-02T20:55:11", "url": "https://files.pythonhosted.org/packages/9a/cd/74d33204d67170e113a5262b2615c549568b5fddbd3a37fba9d2156e6179/urlwait-0.4.tar.gz" } ] }