{ "info": { "author": "trevor grayson", "author_email": "trevor@ipsumllc.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2" ], "description": "# strut\n\nUsing HTTP formatting standards to simplify defining web APIs.\n\nThe Swagger/OpenAPI specifications are generally ubiquitous and extremely useful. The \ndifficulty comes in when having to remember the field names, or how the document\nis structured. Required fields lead to a lot of noise when compiling swagger.\n\nIt is the purpose of this specification to make defining HTTP endpoints much easier with more intuitive entry. By minimizing format and structure, and by leveraging HTTP standards (which may already be known by the developer) it may be quicker and easier\nto define APIs.\n\n## Installation\n\n```\npip install strut\n```\n\n## Creating Definitions\n\nIn order to get use out of this library there are several ways of constructing definitions easily.\n\n### `.http` Files\n\n`.http` files are composed of a collection of HTTP Messages, which can be used \nto describe a service. Standard HTTP Messages (as defined by \n[rfc2616](https://tools.ietf.org/html/rfc2616)) with each separated by double newline characters (in the same way HTTP headers and bodies are separated.) Files can be read in as a `list` of `HttpRequest` objects.\n\nThe simplest definition can be acheived with `\\n\\n` separated [Http Message Request lines](https://tools.ietf.org/html/rfc2616#section-4).\n\n```\nGET /kittens\n\nGET /dogs\nContent-Type: application/json\n\n```\n\n```\nstrut swagger filename.http\n```\n\n### Spec Aggregation as a Service\n\nBy running the `strut-server` script locally, you can use a web browser, curl, [Postman](https://www.getpostman.com/), or any other HTTP client to hit the service, and easily accumulate a specification. \n\nThis can be saved to a `.http` formatted file for reusability.\n\nAn example of this technique could be the following:\n\n```\npip install strut\nstrut-server &\n> serving at port 4110\n\ncurl http://localhost:4110/kittens/\ncurl http://localhost:4110/dogs/\ncurl -XPOST http://localhost:4110/kittens/\n```\n\nThis would generate the following swagger specification:\n\n```\n\ninfo:\n description: ''\n title: Generated by Strut\n version: 1.0.0\nopenapi: 3.0.0\npaths:\n /dogs:\n get:\n description: ''\n responses:\n '200':\n description: ''\n /kittens:\n get:\n description: ''\n responses:\n '200':\n description: ''\n post:\n description: ''\n responses:\n '200':\n description: ''\n\n```\n\n## Features\n\n### Documentation\n\nBy generating [Swagger](https://swagger.io/) yaml/json this project can tap into a rich\ncommunity of GUI definitions.\n\nTo convert a `.http` file into a swagger document:\n\n```\n# yaml\nstrut swagger filename.http\n\n# json \nstrut swagger-json filename.http\n\n```\n\n### Testing\n\nThis format should lead to be able to infer standard [Gherkin Syntax](https://docs.cucumber.io/gherkin/)\ntests, that could automatically generate testing.\n\n```\nstrut gherkin definition.http\n```\n\n### Code Generation\n\nBy compiling down to Swagger code, server code can be generated. See an example implementation on \n[editor.swagger.io/](http://editor.swagger.io/) under the \"Generate Server\" tab.\n\n```\nstrut swagger definition.http\n```\n\n### Web Scripting\n\n`http` files can describe a procedural list of requests to make to a webserver. \nThis can be used to script requests to a service, potentially multiple services \nin future iterations.\n\n## Project Life Cycle\n\n### Testing the Project\n\n```\npytest\n```\n\n### Parsing and Rendering\n\n\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/trevorgrayson/strut", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "strut", "package_url": "https://pypi.org/project/strut/", "platform": "", "project_url": "https://pypi.org/project/strut/", "project_urls": { "Homepage": "https://github.com/trevorgrayson/strut" }, "release_url": "https://pypi.org/project/strut/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "Define HTTP APIs easily.", "version": "1.1.1" }, "last_serial": 4830878, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "15a705924a62051dd9f2582c24f26578", "sha256": "519f39b9253c45bec860302934c213f418a6da2be30f7f1139ae806f3d99f2f5" }, "downloads": -1, "filename": "strut-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "15a705924a62051dd9f2582c24f26578", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6217, "upload_time": "2019-02-17T07:22:15", "url": "https://files.pythonhosted.org/packages/b6/8f/f001a735ef4797b0f15181b75b9a90a907ee2bece8a7b8c90b9e1d9ffcca/strut-1.0.0-py2-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "da4867949e6e4353bdd97cfcb71aa747", "sha256": "c49e32903a00a1f595464d2c6ba576d7af75261b7d695696058221b149cddcf4" }, "downloads": -1, "filename": "strut-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "da4867949e6e4353bdd97cfcb71aa747", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6219, "upload_time": "2019-02-17T07:29:07", "url": "https://files.pythonhosted.org/packages/21/b1/47c59f662bbfb1874479623de53129f9d453a1977c3acba509299eba4b4d/strut-1.0.1-py2-none-any.whl" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "ea190c039dd58303d22dfdb35204b3c3", "sha256": "f4e8879f2bb0c48598f91fc902e4f7685ab94afce0ed3db2a42298843689186e" }, "downloads": -1, "filename": "strut-1.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "ea190c039dd58303d22dfdb35204b3c3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6269, "upload_time": "2019-02-17T07:46:03", "url": "https://files.pythonhosted.org/packages/ad/e9/8f015120367b391f1d34a4cc8a36a5825402d5dc036175ed2b4e0eb89e99/strut-1.1.0-py2-none-any.whl" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "c8244fe6b94010cf10e94200a17e04fd", "sha256": "953795715f1f5bc2c424c9a05aedba72e4071decf9dbaed939d8a663a9bd50df" }, "downloads": -1, "filename": "strut-1.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "c8244fe6b94010cf10e94200a17e04fd", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6221, "upload_time": "2019-02-17T08:30:54", "url": "https://files.pythonhosted.org/packages/5d/0f/8db9ef39beae751334dd99b70bace7148c773fd1d0c6a7b2c1d92cfa58b5/strut-1.1.1-py2-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c8244fe6b94010cf10e94200a17e04fd", "sha256": "953795715f1f5bc2c424c9a05aedba72e4071decf9dbaed939d8a663a9bd50df" }, "downloads": -1, "filename": "strut-1.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "c8244fe6b94010cf10e94200a17e04fd", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6221, "upload_time": "2019-02-17T08:30:54", "url": "https://files.pythonhosted.org/packages/5d/0f/8db9ef39beae751334dd99b70bace7148c773fd1d0c6a7b2c1d92cfa58b5/strut-1.1.1-py2-none-any.whl" } ] }