{ "info": { "author": "Joakim Soderberg", "author_email": "joakim.soderberg@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "## Docker Links Environment Parser (Python version)\n\nThis is a Python rewrite of [docker-links](https://github.com/brotchie/docker-links) for nodejs by @brotchie.\n\n[Docker](http://www.docker.io/) has a feature where you can [link containers together by name](http://docs.docker.io/en/latest/use/working_with_links_names/). For example, you start a redis-server in a docker container and expose the default redis port 6379:\n\n $ docker run -p 6379 -d -name redis vagrant/redis-server\n\nYou then start another containiner running a Django web service that needs to access this redis server:\n\n $ docker run --link redis:db -d vagrant/django\n \nDocker will internally hook up these the two containers and pass host and port information to the Django web service via environment variables:\n\n DB_NAME=/romantic_lumiere/db\n DB_PORT=tcp://172.17.0.5:6379\n DB_PORT_6379_TCP=tcp://172.17.0.5:6379\n DB_PORT_6379_TCP_ADDR=172.17.0.5\n DB_PORT_6379_TCP_PORT=6379\n DB_PORT_6379_TCP_PROTO=tcp\n \nThis library provides a helper `parse_links` that will parse these environment variables into easily navigable Python dictionaries.\n\n### Install\n\nTODO...\n\n### Example Usage\n\nConsider a container that accesses three external services on two other containers. The first container exposes redis on port 6379 and postgres on 6500. The second container exposes redis on port 6379.\n\n DB_NAME=/romantic_lumiere/db\n DB_PORT=tcp://172.17.0.5:6379\n DB_PORT_6379_TCP=tcp://172.17.0.5:6379\n DB_PORT_6379_TCP_ADDR=172.17.0.5\n DB_PORT_6379_TCP_PORT=6379\n DB_PORT_6379_TCP_PROTO=tcp\n DB_PORT_6500_TCP=tcp://172.17.0.5:6500\n DB_PORT_6500_TCP_ADDR=172.17.0.5\n DB_PORT_6500_TCP_PORT=6500\n DB_PORT_6500_TCP_PROTO=tcp\n DB_REDIS_NAME=/romantic_lumiere/db_redis\n DB_REDIS_PORT=tcp://172.17.0.2:6379\n DB_REDIS_PORT_6379_TCP=tcp://172.17.0.2:6379\n DB_REDIS_PORT_6379_TCP_ADDR=172.17.0.2\n DB_REDIS_PORT_6379_TCP_PORT=6379\n DB_REDIS_PORT_6379_TCP_PROTO=tcp\n \nParse with `docker-links`:\n\n```python\n>> import docker_links\n>> import os\n>> links = docker_links.parse_links(os.environ)\n```\n \nLinks is then the following object:\n\n```python\n>> print json.dumps(links, indent=4)\n{\n \"db\": {\n \"name\": \"romantic_lumiere/db\",\n \"proto\": \"tcp\",\n \"url\": \"tcp://172.17.0.5:6379\",\n \"hostname\": \"172.17.0.5\",\n \"tcp\": {\n \"6379\": {\n \"url\": \"tcp://172.17.0.5:6379\",\n \"hostname\": \"172.17.0.5\"\n },\n \"6500\": {\n \"url\": \"tcp://172.17.0.5:6500\",\n \"hostname\": \"172.17.0.5\"\n }\n },\n \"port\": 6379\n },\n \"db_redis\": {\n \"name\": \"romantic_lumiere/db_redis\",\n \"proto\": \"tcp\",\n \"url\": \"tcp://172.17.0.2:6379\",\n \"hostname\": \"172.17.0.2\",\n \"tcp\": {\n \"6379\": {\n \"url\": \"tcp://172.17.0.2:6379\",\n \"hostname\": \"172.17.0.2\"\n }\n },\n \"port\": 6379\n }\n}\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/JoakimSoderberg/docker-links-python", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "docker-links-python", "package_url": "https://pypi.org/project/docker-links-python/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/docker-links-python/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/JoakimSoderberg/docker-links-python" }, "release_url": "https://pypi.org/project/docker-links-python/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A helper for parsing Docker link environment variables.", "version": "0.1.0" }, "last_serial": 1297739, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9d95a5bbddc0fc88204cfaa9d0f2cdff", "sha256": "6921b9815eae185bc0c61f278d6468ff86e501667850950f595cb9657afe0a84" }, "downloads": -1, "filename": "docker_links_python-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9d95a5bbddc0fc88204cfaa9d0f2cdff", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4723, "upload_time": "2014-11-06T23:37:29", "url": "https://files.pythonhosted.org/packages/43/58/9b3ef309a534aca07ace67e1a144e2643dcfcc0147edcbee61f96ae4a990/docker_links_python-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c26c4c0bfcf5db7547fbac74127d858", "sha256": "a3f563f11e3707389a48c56056121a44c83e4db71f9ed04d3d18fcdab3a84924" }, "downloads": -1, "filename": "docker-links-python-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9c26c4c0bfcf5db7547fbac74127d858", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3426, "upload_time": "2014-11-06T23:37:16", "url": "https://files.pythonhosted.org/packages/3b/09/5030e5a19277164c0af71fa879e66b241b690c21c022c41a63bc11309952/docker-links-python-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9d95a5bbddc0fc88204cfaa9d0f2cdff", "sha256": "6921b9815eae185bc0c61f278d6468ff86e501667850950f595cb9657afe0a84" }, "downloads": -1, "filename": "docker_links_python-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9d95a5bbddc0fc88204cfaa9d0f2cdff", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4723, "upload_time": "2014-11-06T23:37:29", "url": "https://files.pythonhosted.org/packages/43/58/9b3ef309a534aca07ace67e1a144e2643dcfcc0147edcbee61f96ae4a990/docker_links_python-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c26c4c0bfcf5db7547fbac74127d858", "sha256": "a3f563f11e3707389a48c56056121a44c83e4db71f9ed04d3d18fcdab3a84924" }, "downloads": -1, "filename": "docker-links-python-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9c26c4c0bfcf5db7547fbac74127d858", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3426, "upload_time": "2014-11-06T23:37:16", "url": "https://files.pythonhosted.org/packages/3b/09/5030e5a19277164c0af71fa879e66b241b690c21c022c41a63bc11309952/docker-links-python-0.1.0.tar.gz" } ] }