{ "info": { "author": "Digium, Inc.", "author_email": "dlee@digium.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": "About\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.\n\n::\n\n $ sudo pip install swaggerpy\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 swaggerpy.client import SwaggerClient\n from swaggerpy.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\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": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/digium/swagger-py", "keywords": null, "license": "BSD 3-Clause License", "maintainer": null, "maintainer_email": null, "name": "swaggerpy", "package_url": "https://pypi.org/project/swaggerpy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/swaggerpy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/digium/swagger-py" }, "release_url": "https://pypi.org/project/swaggerpy/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Library for accessing Swagger-enabled API's", "version": "0.2.1" }, "last_serial": 1187187, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "abe2a6e8f0574555f04754a53fa98e3a", "sha256": "3ab01d604cb83379bb774bf0361eae568bdd13fc2a288ed2db2598e9801e73a4" }, "downloads": -1, "filename": "swaggerpy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "abe2a6e8f0574555f04754a53fa98e3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14523, "upload_time": "2013-10-24T20:55:10", "url": "https://files.pythonhosted.org/packages/c8/71/74b1cc8982d26888e985358f7835663be51c3eca644662618aec911d8fa2/swaggerpy-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "8271dfe7e1b9c9ec1c14b76344170992", "sha256": "30641b5e56525ad7391c4624b5811a650b737cb96b6e8193e38369dd6c8e7d9f" }, "downloads": -1, "filename": "swaggerpy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8271dfe7e1b9c9ec1c14b76344170992", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14750, "upload_time": "2013-10-28T15:59:59", "url": "https://files.pythonhosted.org/packages/a6/6b/c9fac06b8c8fb4af1eefa585dafc80982b06fb6c9b7b5af3f1711107388e/swaggerpy-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b77a35dff361f2d771c9801335a4caea", "sha256": "fa54bc2b17eb9ed181bc0b5321b180839f14ce6c86792450d92e9fcdb1acad1f" }, "downloads": -1, "filename": "swaggerpy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "b77a35dff361f2d771c9801335a4caea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12620, "upload_time": "2014-08-12T02:57:37", "url": "https://files.pythonhosted.org/packages/84/b9/158f0f2f11a61ec5b64c39cf0a70007f5b44773d6bbf8a10c73e36ce88af/swaggerpy-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b77a35dff361f2d771c9801335a4caea", "sha256": "fa54bc2b17eb9ed181bc0b5321b180839f14ce6c86792450d92e9fcdb1acad1f" }, "downloads": -1, "filename": "swaggerpy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "b77a35dff361f2d771c9801335a4caea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12620, "upload_time": "2014-08-12T02:57:37", "url": "https://files.pythonhosted.org/packages/84/b9/158f0f2f11a61ec5b64c39cf0a70007f5b44773d6bbf8a10c73e36ce88af/swaggerpy-0.2.1.tar.gz" } ] }