{ "info": { "author": "Mariano Ruiz", "author_email": "mrsarm@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "License :: Public Domain", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", "Topic :: System :: Networking" ], "description": "Simple Resource Address Parser\n==============================\n\nPython module to parse simple network resource addresses, like the ones\nused in many database systems to represent a database URI.\n\n``res_address`` will be used by `Mongotail `_\nto parse the address passed through command line (migration in progress), but can be used\nby any other Python application that needs to parse a MongoDB database address,\nor any other network resource like ``[[HOST OR IP][:PORT]/]RESOURCE``.\n\nUsage:\n\n.. code:: python\n\n >>> from res_address import get_res_address\n >>> host, port, resource = get_res_address(\"localhost:27017/test\")\n >>> print(host, port, resource)\n localhost 27017 test\n >>> host, port, resource = get_res_address(\"my_db\")\n >>> print(host, port, resource)\n None None my_db\n >>> ipv6, port, resource = get_res_address(\"[::1]:9999/foo\")\n >>> print(ipv6, port, resource)\n [::1] 9999 foo\n\n\n\nThe address can be:\n\n+----------------------+-------------------------------------------------------------+\n| foo | foo resource on local machine (IPv4 connection) |\n+----------------------+-------------------------------------------------------------+\n| 192.169.0.5/foo | foo resource on 192.168.0.5 machine |\n+----------------------+-------------------------------------------------------------+\n| remotehost/foo | foo resource on *remotehost* machine |\n+----------------------+-------------------------------------------------------------+\n| 192.169.0.5:9999/foo | foo resource on 192.168.0.5 machine on port 9999 |\n+----------------------+-------------------------------------------------------------+\n| \"[::1]:9999/foo\" | foo resource on ::1 machine on port 9999 (IPv6 connection) |\n+----------------------+-------------------------------------------------------------+\n| :1234/foo | foo resource on port 1234 |\n+----------------------+-------------------------------------------------------------+\n\nSome validations are performed over the host, port and resource strings, and an\nexception is launched if some of the checks fails, but take into account that\ninvalid range IPs or incompatible resource names may pass:\n\n.. code:: python\n\n >>> host, port, resource = get_res_address(\"localhost:INVALIDport/test\")\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"res_address/__init__.py\", line 74, in get_res_address\n raise InvalidPortError('Invalid port number \"%s\"' % port, address, port)\n res_address.InvalidPortError: Invalid port number \"INVALIDport\"\n\nAll the validation exceptions inherit from ``AddressError``:\n\n* ``InvalidHostError``\n* ``InvalidPortError``\n* ``InvalidResourceError``\n* ``NotResourceProvidedError``\n\n\nRun the test\n------------\n\nJust execute (Python 2 or 3)::\n\n $ python setup.py test\n\n\nOr::\n\n $ python -m unittest -v tests\n\n\nAbout\n-----\n\nProject: https://github.com/mrsarm/python-res-address\n\nAuthors: (2018-2019) Mariano Ruiz \n\nLicense: LGPL-3", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/mrsarm/python-res-address/tarball/1.0.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mrsarm/python-res-address", "keywords": "", "license": "LGPL-3", "maintainer": "", "maintainer_email": "", "name": "res-address", "package_url": "https://pypi.org/project/res-address/", "platform": "any", "project_url": "https://pypi.org/project/res-address/", "project_urls": { "Download": "https://github.com/mrsarm/python-res-address/tarball/1.0.0", "Homepage": "https://github.com/mrsarm/python-res-address" }, "release_url": "https://pypi.org/project/res-address/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Simple Resource Address Parser.", "version": "1.0.0" }, "last_serial": 4889952, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "a5390b2793aa4ff5975a968e8dedaae6", "sha256": "96bf2bd32a51fb2238b0752876c44979b5ab6eeecbae5a31d52a3d8f9800e56a" }, "downloads": -1, "filename": "res-address-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a5390b2793aa4ff5975a968e8dedaae6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17414, "upload_time": "2019-03-03T04:51:09", "url": "https://files.pythonhosted.org/packages/40/8c/0efffb1414b6e664e8aaf1b73c3ae1c259788f45ec7c4db1c26d41b78bb7/res-address-1.0.0.tar.gz" } ], "1.0.0b2": [ { "comment_text": "", "digests": { "md5": "3e872bac48011255351516886f47c62c", "sha256": "b9cf61d84be9cbebedc427c5c912952491515dc690be00a71dadcf0092d22ef4" }, "downloads": -1, "filename": "res_address-1.0.0b2-py3.6.egg", "has_sig": false, "md5_digest": "3e872bac48011255351516886f47c62c", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 5610, "upload_time": "2019-03-03T04:51:06", "url": "https://files.pythonhosted.org/packages/b1/99/ccf1a633fe067c3b513b30a81bdd487d804d046d76cd356897fb962fb89a/res_address-1.0.0b2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "50eedac540a1e9805278412f38200a09", "sha256": "fbaba03122f3b08d3b7d77781083b96dd3acde175e25cdf02b56ae3ac99237fb" }, "downloads": -1, "filename": "res-address-1.0.0b2.tar.gz", "has_sig": false, "md5_digest": "50eedac540a1e9805278412f38200a09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17421, "upload_time": "2019-03-03T04:51:08", "url": "https://files.pythonhosted.org/packages/e1/f3/3a7503eb588188c37f1fc21157141c7c5e706ea7b6c26d2e5114ee08ea47/res-address-1.0.0b2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a5390b2793aa4ff5975a968e8dedaae6", "sha256": "96bf2bd32a51fb2238b0752876c44979b5ab6eeecbae5a31d52a3d8f9800e56a" }, "downloads": -1, "filename": "res-address-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a5390b2793aa4ff5975a968e8dedaae6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17414, "upload_time": "2019-03-03T04:51:09", "url": "https://files.pythonhosted.org/packages/40/8c/0efffb1414b6e664e8aaf1b73c3ae1c259788f45ec7c4db1c26d41b78bb7/res-address-1.0.0.tar.gz" } ] }