{ "info": { "author": "Digium, Inc and Infectious Media", "author_email": "sre@infectiousmedia.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Swagger Python\n--------------\n\nThis is an update of swaggerpython, with Python3 support and a few fixes.\n\nPRs and issues welcome.\n\nAbout\n-----\n\nSwagger.py is a Python library for using\n`Swagger `__ defined API's.\n\nSwagger itself is best described on the Swagger home page:\n\n Swagger is a specification and complete framework implementation for\n describing, producing, consuming, and visualizing RESTful web\n services.\n\nThe `Swagger\nspecification `__ defines\nhow API's may be described using Swagger.\n\nSwagger.py also supports a WebSocket extension, allowing a WebSocket to\nbe documented, and auto-generated WebSocket client code.\n\nUsage\n-----\n\nInstall the latest release from PyPI. This is our forked version.\n\n::\n\n $ sudo pip install swaggerpython\n\nOr install from source using the ``setup.py`` script.\n\n::\n\n $ sudo ./setup.py install\n\nAPI\n===\n\nSwagger.py will dynamically build an object model from a Swagger-enabled\nRESTful API.\n\nHere is a simple example using the `Asterisk REST\nInterface `__\n\n.. code:: Python\n\n #!/usr/bin/env python\n\n import json\n\n from swaggerpython.client import SwaggerClient\n from swaggerpython.http_client import SynchronousHttpClient\n\n http_client = SynchronousHttpClient()\n http_client.set_basic_auth('localhost', 'hey', 'peekaboo')\n\n ari = SwaggerClient(\n \"http://localhost:8088/ari/api-docs/resources.json\",\n http_client=http_client)\n\n ws = ari.events.eventWebsocket(app='hello')\n\n for msg_str in iter(lambda: ws.recv(), None):\n msg_json = json.loads(msg_str)\n if msg_json['type'] == 'StasisStart':\n channelId = msg_json['channel']['id']\n ari.channels.answer(channelId=channelId)\n ari.channels.play(channelId=channelId,\n media='sound:hello-world')\n ari.channels.continueInDialplan(channelId=channelId)\n\nswagger-codegen\n===============\n\nThere are the beginnings of a Mustache-based code generator, but it's\nnot functional... yet.\n\n.. Inspired by the original [swagger-codegen][] project, templates are\n written using [Mustache][] templates ([Pystache][], specifically).\n There are several important differences.\n\n * The model that is fed into the mustache templates is almost\n identical to Swagger's API resource listing and API declaration\n model. The differences are listed [below](#model).\n * The templates themselves are completely self contained, with the\n logic to enrich the model being specified in `translate.py` in the\n same directory as the `*.mustache` files.\n\nData model\n==========\n\nThe data model presented by the ``swagger_model`` module is nearly\nidentical to the original Swagger API resource listing and API\ndeclaration. This means that if you add extra custom metadata to your\ndocs (such as a ``_author`` or ``_copyright`` field), they will carry\nforward into the object model. I recommend prefixing custom fields with\nan underscore, to avoid collisions with future versions of Swagger.\n\nThere are a few meaningful differences.\n\n- Resource listing\n- The ``file`` and ``base_dir`` fields have been added, referencing the\n original ``.json`` file.\n- The objects in a ``resource_listing``'s ``api`` array contains a\n field ``api_declaration``, which is the processed result from the\n referenced API doc.\n- API declaration\n- A ``file`` field has been added, referencing the original ``.json``\n file.\n\nDevelopment\n-----------\n\nThe code is documented using `Sphinx `__, which\nallows `IntelliJ IDEA `__\nto do a better job at inferring types for autocompletion.\n\nTo keep things isolated, I also recommend installing (and using)\n`virtualenv `__.\n\n::\n\n $ sudo pip install virtualenv\n $ mkdir -p ~/virtualenv\n $ virtualenv ~/virtualenv/swagger\n $ . ~/virtualenv/swagger/bin/activate\n\n`Setuptools `__ is used for\nbuilding. `Nose `__ is used\nfor unit testing, with the `coverage\n`__ plugin installed to\ngenerated code coverage reports. Pass ``--with-coverage`` to generate\nthe code coverage report. HTML versions of the reports are put in\n``cover/index.html``.\n\n::\n\n $ ./setup.py develop # prep for development (install deps, launchers, etc.)\n $ ./setup.py nosetests # run unit tests\n $ ./setup.py bdist_egg # build distributable\n\n\nTODO\n----\n\nmypy?\n\n\nLicense\n-------\n\nCopyright (c) 2013, Digium, Inc. All rights reserved.\n\nSwagger.py is licensed with a `BSD 3-Clause\nLicense `__.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/poogles/swagger-python", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "swaggerpython", "package_url": "https://pypi.org/project/swaggerpython/", "platform": "", "project_url": "https://pypi.org/project/swaggerpython/", "project_urls": { "Homepage": "https://github.com/poogles/swagger-python" }, "release_url": "https://pypi.org/project/swaggerpython/0.2.3/", "requires_dist": null, "requires_python": "", "summary": "Library for accessing Swagger-enabled API's", "version": "0.2.3" }, "last_serial": 3541259, "releases": { "0.2.2": [ { "comment_text": "", "digests": { "md5": "ac713ecf703d507231179da2a16270d4", "sha256": "5b7f1ce88d141efbfda48189be26b943a726d00423de5ea7598e7a48913074cc" }, "downloads": -1, "filename": "swaggerpython-0.2.2.tar.gz", "has_sig": false, "md5_digest": "ac713ecf703d507231179da2a16270d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15250, "upload_time": "2018-02-01T11:20:31", "url": "https://files.pythonhosted.org/packages/7b/00/632cbaeb4af1ddf2b1616db92b2d4bc0894c6b8c2d22a8cc7ea471fc4b79/swaggerpython-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "0fd77e44e2ddab2367fb8dedf371c77d", "sha256": "643346c3294d525be8506c285b487b8623a4a5967c5c90c550c74b1966ba3864" }, "downloads": -1, "filename": "swaggerpython-0.2.3.tar.gz", "has_sig": false, "md5_digest": "0fd77e44e2ddab2367fb8dedf371c77d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15357, "upload_time": "2018-02-01T11:25:18", "url": "https://files.pythonhosted.org/packages/8e/a4/62ebbe36788f73b84d4d0ff41146edf89fd723e8f568d5cbdc9d2df41e38/swaggerpython-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0fd77e44e2ddab2367fb8dedf371c77d", "sha256": "643346c3294d525be8506c285b487b8623a4a5967c5c90c550c74b1966ba3864" }, "downloads": -1, "filename": "swaggerpython-0.2.3.tar.gz", "has_sig": false, "md5_digest": "0fd77e44e2ddab2367fb8dedf371c77d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15357, "upload_time": "2018-02-01T11:25:18", "url": "https://files.pythonhosted.org/packages/8e/a4/62ebbe36788f73b84d4d0ff41146edf89fd723e8f568d5cbdc9d2df41e38/swaggerpython-0.2.3.tar.gz" } ] }