{ "info": { "author": "Thomas Grimonet", "author_email": "tom@inetsix.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7" ], "description": "# Inetsix Python toolbox\n\n[![Build Status](https://travis-ci.org/titom73/inetsix-python-lib.svg?branch=master)](https://travis-ci.org/titom73/inetsix-python-lib) [![Documentation Status](https://readthedocs.org/projects/inetsix-python-lib/badge/?version=latest)](https://inetsix-python-lib.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/inetsix.svg)](https://badge.fury.io/py/inetsix)\n\nThis module provides some generic python functions usually used in many of scripts.\nInstead of rewriting these functions in all scripts, we have put them in a single module.\n\n__Current classes:__\n\n- [`ExcelSerializer`](inetsix/excel.py) from `inetsix.excel`: Class to serialize excel spreadsheet into Python structure to be consume in scripts or templates\n- [`InetsixTools`](inetsix/tools.py) from `inetsix.tools`: Use `@classmethod` to provide some generic functions\n - PPRINT rendering\n - List of files in a given directory\n - Get basname of a complete path to a file\n - Extract a `list()` of unique values in a `list()`\n - Convert a `dict()` to a `list()`\n - Download file with HTTP/HTTPS transport\n - Set variable from user environment\n\n## Installation\n\n```shell\n$ pip install inetsix\n```\n\n## Quick Start\n\n### Generic tools Functions usage\nThis example shows you how to use some functions:\n\n```python\nimport inetsix.tools\nimport os\nimport logging\n\nFOLDER='../dist/'\nSTRUCTURE_JPRINT='{\"access\":10,\"configured\":true,\"hostname\":\"leaf1-demo\",\"mode\":\"switch\",\"description\":\"Access interface\",\"name\":\"ethernet 1\"}'\nURI_DOWNLOAD='https://web.inetsix.net/index.html'\n\nif __name__ == '__main__':\n logging.basicConfig(level=logging.DEBUG)\n logging.info('Starting test with version: '+inetsix.version)\n\n # Print a JSON structure\n # without initiate a pprint configuration\n\n logging.info('Validate inetsix.jprint with JSON string')\n inetsix.tools.InetsixTools.jprint(STRUCTURE_JPRINT)\n\n # List all file with `whl` extension in a given directory\n # Result is a list of filenames\n\n logging.info('Validation inetsix.get_list_files')\n print inetsix.tools.InetsixTools.get_list_files(path=FOLDER, extension='whl')\n\n # Download a file from an HTTPS server\n # and save it in the current directory\n\n logging.info('Test download validation with HTTPS')\n result = inetsix.tools.InetsixTools.download_file(remote_file=URI_DOWNLOAD)\n logging.info('Downloaded file %s', result)\n logging.warning('remove downloaded file')\n os.remove(result)\n\n logging.info('End process validation')\n```\n\nit can also be used with following syntax:\n\n```python\nfrom inetsix.tools import InetsixTools\n\nSTRUCTURE_JPRINT='{\"access\":10,\"configured\":true,\"hostname\":\"leaf1-demo\",\"mode\":\"switch\",\"description\":\"Access interface\",\"name\":\"ethernet 1\"}'\nURI_DOWNLOAD='https://web.inetsix.net/index.html'\n\nInetsixTools.jprint(STRUCTURE_JPRINT)\nresult = InetsixTools.download_file(remote_file=URI_DOWNLOAD)\n```\n\n> As code was built with come generic function directly on top of the library, those ones will remains for legacy but not maintained anymore\n\n### Class use case:\n\n```python\nimport inetsix\nimport logging\nfrom inetsix.excel import ExcelSerializer\n\nEXCELFILENAME = '.ci/excel-demo.xlsx'\n\nif __name__ == '__main__':\n logging.basicConfig(level=logging.DEBUG)\n\n myExcel = ExcelSerializer(excel_path=EXCELFILENAME)\n myExcel.serialize_table(sheet=\"test\", nb_columns=3)\n\n inetsix.jprint(myExcel.get_data(sheet=\"test\"))\n```\n\nOutput example:\n\n```shell\n[ { u'address': '10.0.0.1/24', u'id': '1', u'name': 'eh0'},\n { u'address': '10.0.10.1/24', u'id': '2', u'name': 'eth1'},\n { u'address': '10.0.20.1/24', u'id': '3', u'name': 'eth2'}]\n```\n\n## Get code documentation\n\nTo get code documentation, use command:\n\n```\n$ python\n\n>>> import inetsix\n>>> help(inetsix)\n\n>>> from inetsix.excel import ExcelSerializer\n>>> help(ExcelSerializer)\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/titom73/inetsix-python-lib", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "inetsix", "package_url": "https://pypi.org/project/inetsix/", "platform": "", "project_url": "https://pypi.org/project/inetsix/", "project_urls": { "Homepage": "https://github.com/titom73/inetsix-python-lib" }, "release_url": "https://pypi.org/project/inetsix/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Inetsix tools library", "version": "0.0.4" }, "last_serial": 4987160, "releases": { "0.0.1a0": [ { "comment_text": "", "digests": { "md5": "0e16586a85da6848b6bd1967fff57bf1", "sha256": "118ea86c8dca43b37f49c3ace3a9a1fdeadbc76eb445932b75099db55dd9b0c2" }, "downloads": -1, "filename": "inetsix-0.0.1a0-py2-none-any.whl", "has_sig": false, "md5_digest": "0e16586a85da6848b6bd1967fff57bf1", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9487, "upload_time": "2019-02-24T12:55:29", "url": "https://files.pythonhosted.org/packages/18/00/a2730bf0c47da85015f2a1b7697329d8f0b062338566117b95b93012380e/inetsix-0.0.1a0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7eec035648749578b96f5d25ba051554", "sha256": "e14601bb63bc3d01d5c16b57e8d830db3b115cf6ad7121890c491679fcf1e9e1" }, "downloads": -1, "filename": "inetsix-0.0.1a0.tar.gz", "has_sig": false, "md5_digest": "7eec035648749578b96f5d25ba051554", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7693, "upload_time": "2019-02-24T12:55:31", "url": "https://files.pythonhosted.org/packages/a1/53/726a5a657580cba8ae1d7d4e01ec6f5b0abe54a71db4dc2598667a94e1a3/inetsix-0.0.1a0.tar.gz" } ], "0.0.1b0": [ { "comment_text": "", "digests": { "md5": "d1cd5a77da69b5c7c532bc38b5b1278f", "sha256": "46b2da57f29fe3f998b6248a9e0fcc8ad6493c2d8e495b22aaddff73dfc5566b" }, "downloads": -1, "filename": "inetsix-0.0.1b0-py2-none-any.whl", "has_sig": false, "md5_digest": "d1cd5a77da69b5c7c532bc38b5b1278f", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9488, "upload_time": "2019-02-24T13:00:55", "url": "https://files.pythonhosted.org/packages/11/8d/e382b69f846a050542da0c8f026cde6ec448db2a9ea87018bb6d6a0d5e0d/inetsix-0.0.1b0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81d68ff0c1058f5efc94f1ebbde440a3", "sha256": "ffd059855f31df81b9f0232b961fc769dfe268c6fef939e6c42264e07ea01fa8" }, "downloads": -1, "filename": "inetsix-0.0.1b0.tar.gz", "has_sig": false, "md5_digest": "81d68ff0c1058f5efc94f1ebbde440a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7693, "upload_time": "2019-02-24T13:00:57", "url": "https://files.pythonhosted.org/packages/6c/39/3917352ab09674891de872b4dd86b9049ac6de4e9d7dba0439341032b409/inetsix-0.0.1b0.tar.gz" } ], "0.0.1rc0": [ { "comment_text": "", "digests": { "md5": "2d4a6cda84cd3a98297d6f494a1f9873", "sha256": "4d8f8fce1db5034cb4ef7947bf8bcaaab069fd62233d1836f65e87fe25067310" }, "downloads": -1, "filename": "inetsix-0.0.1rc0.tar.gz", "has_sig": false, "md5_digest": "2d4a6cda84cd3a98297d6f494a1f9873", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8154, "upload_time": "2019-02-24T13:42:11", "url": "https://files.pythonhosted.org/packages/c5/86/6902e08fb22e278e267ab056cb8daa1c4a2d92bf8e57907c9a3aaf40ade5/inetsix-0.0.1rc0.tar.gz" } ], "0.0.1rc1": [ { "comment_text": "", "digests": { "md5": "abfb87e9dec7b320fce826866b0dbe5a", "sha256": "b4671b78a9512d2bded3f3fee9ee0d82299620b87f82395d03846bf67ebffce0" }, "downloads": -1, "filename": "inetsix-0.0.1rc1.tar.gz", "has_sig": false, "md5_digest": "abfb87e9dec7b320fce826866b0dbe5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8132, "upload_time": "2019-02-24T14:21:14", "url": "https://files.pythonhosted.org/packages/4f/6d/e72b91b4751c661736d6bdcd586d26f49b9846773c792993f63ed9519d84/inetsix-0.0.1rc1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0538ae9491de36dbe6f6d361e1f6b16c", "sha256": "aa77866a0378a3256dc427b2a733425cccbb128984fbd5e39dc266051a0e2904" }, "downloads": -1, "filename": "inetsix-0.0.2.tar.gz", "has_sig": false, "md5_digest": "0538ae9491de36dbe6f6d361e1f6b16c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10171, "upload_time": "2019-02-24T15:30:40", "url": "https://files.pythonhosted.org/packages/62/60/8bc44804bdafe5e29f3fc002f70ab3d18811019010bc5e66cb97867872ca/inetsix-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "ee827114a5050ad30e5123a67e1aae68", "sha256": "ca0e46b65c10debd502231b43c10d81f086c15d7f93bdcd31cb91d8760e2b22c" }, "downloads": -1, "filename": "inetsix-0.0.3.tar.gz", "has_sig": false, "md5_digest": "ee827114a5050ad30e5123a67e1aae68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11191, "upload_time": "2019-03-03T11:36:35", "url": "https://files.pythonhosted.org/packages/56/21/ef115a071026c93f4156a94f6362aff93a1e6150664e223230e4b0f84bf1/inetsix-0.0.3.tar.gz" } ], "0.0.3a0": [ { "comment_text": "", "digests": { "md5": "423a103da40765852163f555871c526c", "sha256": "3a90f75bb61775511db93ccb87d0f8690300a1fde6a96d21edc8990658863c9a" }, "downloads": -1, "filename": "inetsix-0.0.3a0.tar.gz", "has_sig": false, "md5_digest": "423a103da40765852163f555871c526c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11177, "upload_time": "2019-03-03T11:40:27", "url": "https://files.pythonhosted.org/packages/22/d4/e62b9a94eeb0a56615bf2b96bf524a9e21532cf95b2e4a169a9e13bc7d83/inetsix-0.0.3a0.tar.gz" } ], "0.0.3b0": [ { "comment_text": "", "digests": { "md5": "428ce9b6e41d7df91b01828c743d4b88", "sha256": "e001e6e7971a6c595eecdaba3d7baadc507bac090a92e8c079aed54a011f0ab5" }, "downloads": -1, "filename": "inetsix-0.0.3b0.tar.gz", "has_sig": false, "md5_digest": "428ce9b6e41d7df91b01828c743d4b88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11471, "upload_time": "2019-03-26T11:08:14", "url": "https://files.pythonhosted.org/packages/87/0d/c25457d899b981ea00c2044808fd0261ec25bfcbc3a948ddf9c0afcc0d17/inetsix-0.0.3b0.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "9d93b113cf5fbccc1c354be17c276a8f", "sha256": "b38f0423ef455097e02bd26a285a8eda73ed30592bba676ec7308bd3125b51f2" }, "downloads": -1, "filename": "inetsix-0.0.4.tar.gz", "has_sig": false, "md5_digest": "9d93b113cf5fbccc1c354be17c276a8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11463, "upload_time": "2019-03-26T11:10:57", "url": "https://files.pythonhosted.org/packages/dc/64/77fc015be32e64fadc266e63015ae72995a07b7bf535afea7eb75cefbadf/inetsix-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9d93b113cf5fbccc1c354be17c276a8f", "sha256": "b38f0423ef455097e02bd26a285a8eda73ed30592bba676ec7308bd3125b51f2" }, "downloads": -1, "filename": "inetsix-0.0.4.tar.gz", "has_sig": false, "md5_digest": "9d93b113cf5fbccc1c354be17c276a8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11463, "upload_time": "2019-03-26T11:10:57", "url": "https://files.pythonhosted.org/packages/dc/64/77fc015be32e64fadc266e63015ae72995a07b7bf535afea7eb75cefbadf/inetsix-0.0.4.tar.gz" } ] }