{ "info": { "author": "SvenMatzke", "author_email": "matzke.sven@googlemail.com", "bugtrack_url": null, "classifiers": [], "description": "The catch\n=========\nThe first start for every webserver is routing and parsing html.\nThis is the core.\n\n\nRouting\n=======\nRouter objects are simple and are input to the server instances.\nExample:\n::\n\n from userv.routing import Router, text_response\n\n router = Router()\n\n def test(request):\n return text_response(\"some text\")\n\n router.add(\"/resturl\", test, method=\"GET\")\n\nyou can get function test again with:\n::\n\n router.get('/resturl', method=\"GET\")\n\n\nfor creating swagger and so on there is a also a list command:\n::\n\n router.list()\n\nWith these routes in one place we have full control even without\nan server instance.\n\nResponse types\n==============\nThere are a few build in response types text, json and static files.\n\nThe general gist of the response functions is to create a generator\nwhich will be used to consumed by your server.\n\nif you want to have full control about your memory flow or need to write a few\nmemory hungry responses feel free to write an response yourself.\n\nLittle hint make sure to use the response_header function and end the response with\nan \"\\\\r\\\\n\".\n\n\nServe static files\n==================\nIt is pretty simple just add the address with the file you want to serve.\n\nExample:\n::\n\n from userv.routing import static_file\n\n router.add(\"/index\", static_file('boot.py'))\n\nAlthough the example should never expose your code. It is a pretty simple and fast test.\n\n\nSwagger your api\n================\nswagger.io is the a good way to document your api. This section is a quick way to serve an swagger.json\nfrom your server. To view the api you can embed a swagger_index.html with cdn\u00c2\u00b4s.\n\nExample for description:\n::\n\n # Get requests have a parameter description\n @swagger.info(\"My_funny summary\")\n @swagger.parameter('myvarname', description=\"\", example='sdfs', required=True)\n @swagger.response(200, 'smth is off')\n def myrest_func(request):\n raise\n\n\n # Post request needs a body description\n @swagger.info(\"My_funny summary\")\n @swagger.body('weatherinfo', {'tada': \"examplevar\",\n \"tada2\": 2})\n @swagger.response(200, 'smth is off')\n def post_myrest_func(request):\n raise\n\n router.add(\"/resturl\", myrest_func, method=\"GET\")\n router.add(\"/resturl\", post_myrest_func, method=\"POST\")\n\n\n\nExample to serve swagger.json:\n::\n\n from userv.swagger import swagger_file, swagger_index\n router.add(\"/rest/swagger.json\", swagger_file('my swagger api', \"api title\", router_instance=router))\n\n router.add(\"/rest/index.html, swagger_index(host=\"127.0.0.1\", swagger_json_url=\"rest/swagger.json\")\n\nthe example shows we add the router_instance and therefore all routes registered to that point.\nmeaning if you want all routes in your swagger add the swagger_file shortly before running.\n\nNow all you need to do is set proper host adresses and call up the index url in one or your browsers.\nBecause this is IoT always have in mind qr-codes and other links are easy to create and glue on your device.\n\nFurther packages & webserver\n============================\nAtm there is an implementation for an socketserver which runs even on on esp8266::\n\n pip install userv.socket_server\n\nAnd an async server with an exchangable interface.::\n\n pip install userv.async_server", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SvenMatzke/userv", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "userv", "package_url": "https://pypi.org/project/userv/", "platform": "", "project_url": "https://pypi.org/project/userv/", "project_urls": { "Homepage": "https://github.com/SvenMatzke/userv" }, "release_url": "https://pypi.org/project/userv/0.7.1/", "requires_dist": null, "requires_python": "", "summary": "Minimalistic core for webserver on microcontroler", "version": "0.7.1" }, "last_serial": 5914010, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a31c0faa4065ba10318d9ae02bf065ab", "sha256": "35e1b1248c96fc1e28bae961460fca7d31979cec3ca4d4836cd7aa4e08e59f0e" }, "downloads": -1, "filename": "userv-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a31c0faa4065ba10318d9ae02bf065ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3922, "upload_time": "2019-03-11T17:46:45", "url": "https://files.pythonhosted.org/packages/fa/c1/f8739b9dd4f66bca64a882c3db0c0a16d4a4ea647af09742081ce7a84a36/userv-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "c3d5805c58a99b455870a5b562c825d5", "sha256": "f0992914e3491cb8f2a196223403172202ac028002d0ea25157876ffeafb12a5" }, "downloads": -1, "filename": "userv-0.2.0.tar.gz", "has_sig": false, "md5_digest": "c3d5805c58a99b455870a5b562c825d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2699, "upload_time": "2019-06-17T19:21:25", "url": "https://files.pythonhosted.org/packages/48/18/37a36a070e5442339b80a67d33ead1687f4b68afe8c30701cb219022deb5/userv-0.2.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "e1c6c93a028ef66865cf9d601243fda0", "sha256": "7b78cec2b77d6e745e82dd5c1b8cb47805560a8607360c5e9e70c149316bd8a8" }, "downloads": -1, "filename": "userv-0.4.0.tar.gz", "has_sig": false, "md5_digest": "e1c6c93a028ef66865cf9d601243fda0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3338, "upload_time": "2019-06-24T17:39:22", "url": "https://files.pythonhosted.org/packages/c2/0e/bd7172672d8753478fb049e55dbc929dbb78227ab804b5b4e171da320dde/userv-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "0eb89867581cda78d7857e74a6c40789", "sha256": "2720fee0f844a263452480b657cebe97837c52cd99b9dde8d2a7c705e3497b04" }, "downloads": -1, "filename": "userv-0.4.1.tar.gz", "has_sig": false, "md5_digest": "0eb89867581cda78d7857e74a6c40789", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3779, "upload_time": "2019-06-26T15:54:01", "url": "https://files.pythonhosted.org/packages/e8/e6/669b04156ce2722e973bdbc7d5dafe63732f72890219aef3f7911539d852/userv-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "97b6cdc644c95a93c8833168262069ca", "sha256": "252b176bc0a3ba5b68f01ead8c039d70797d162adc656b724128bbd9a0679e64" }, "downloads": -1, "filename": "userv-0.4.2.tar.gz", "has_sig": false, "md5_digest": "97b6cdc644c95a93c8833168262069ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3778, "upload_time": "2019-06-26T16:29:52", "url": "https://files.pythonhosted.org/packages/e6/f4/c01c223f58f88a75c32b14c951d052bd7d2866c84153bcd2ef5b7df3f21d/userv-0.4.2.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "174d017956cbb5ef3b94545cd56f1991", "sha256": "38bb85c8271070740c1d546d271064083e6fe4fd83b3d18d92664f3e548590a1" }, "downloads": -1, "filename": "userv-0.5.0.tar.gz", "has_sig": false, "md5_digest": "174d017956cbb5ef3b94545cd56f1991", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6623, "upload_time": "2019-07-18T18:26:48", "url": "https://files.pythonhosted.org/packages/57/e8/7ba2c6428c02b131cc15854b5307b1faa8eafb7363c63b237cfadeb3c93c/userv-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "5cec957e6409af8c0b2f374d1cfbffdc", "sha256": "5c5c3c137a8ff2004a3e8b864b24efb08d28ad8e479673265b7d655d42e4aca8" }, "downloads": -1, "filename": "userv-0.5.1.tar.gz", "has_sig": false, "md5_digest": "5cec957e6409af8c0b2f374d1cfbffdc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7327, "upload_time": "2019-07-23T18:42:11", "url": "https://files.pythonhosted.org/packages/7c/44/4abb9daaa067f1bf00c191d9d3497494c2196741c0c098b9bc40ce88e485/userv-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "2a7d6500a65113277fad963806aac53b", "sha256": "02bb8a45b93b938468952af1fc3d9470d9a51e321896a44b5de3b9bc98e42487" }, "downloads": -1, "filename": "userv-0.5.2.tar.gz", "has_sig": false, "md5_digest": "2a7d6500a65113277fad963806aac53b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7369, "upload_time": "2019-07-24T20:27:50", "url": "https://files.pythonhosted.org/packages/32/cf/ab138ce1ca099e6ccc870ad41a6565f33a5842e9368ddf506f3a6f683fc8/userv-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "597aeec1659329e9f08813d217eb631e", "sha256": "c7822abb9ef100ff380c2005ab776fba16dc7f71215fd01bc639f54f9bc25d36" }, "downloads": -1, "filename": "userv-0.5.3.tar.gz", "has_sig": false, "md5_digest": "597aeec1659329e9f08813d217eb631e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7378, "upload_time": "2019-09-02T14:46:51", "url": "https://files.pythonhosted.org/packages/39/d6/7871e46da57ccebdc097a4ce3274d52809b929edcff60ffe534e758300f5/userv-0.5.3.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "6415bf95aae0c4a48a25617da559a2d7", "sha256": "18371b143c22ebb206b999b9cd0d9d230b3b17b7fa1238bdd0cf8783e4d523d7" }, "downloads": -1, "filename": "userv-0.6.0.tar.gz", "has_sig": false, "md5_digest": "6415bf95aae0c4a48a25617da559a2d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7521, "upload_time": "2019-09-02T18:48:07", "url": "https://files.pythonhosted.org/packages/b8/de/378f4dcda3f99ba78d7a23c8b21048f33f0570bf97639867375235151d46/userv-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "c43e92df8f4bdca80305a4199f1055d4", "sha256": "594fbae77bf756b390a0b8c4265b6d02beabed23c7b1a0008c82b1a6eb9398d4" }, "downloads": -1, "filename": "userv-0.7.0.tar.gz", "has_sig": false, "md5_digest": "c43e92df8f4bdca80305a4199f1055d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8329, "upload_time": "2019-10-01T17:42:23", "url": "https://files.pythonhosted.org/packages/93/19/ce2f6debf63a5c9bfd22ddc539760347ac8f8a44a2ff8e8384f2b99537f3/userv-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "2ea2b0d3485ae94c4083c266c9247ac4", "sha256": "9e381faa2a7734cdd6dfb436a604d30abdb2c1d44a854e993d54060be2ae5abb" }, "downloads": -1, "filename": "userv-0.7.1.tar.gz", "has_sig": false, "md5_digest": "2ea2b0d3485ae94c4083c266c9247ac4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8333, "upload_time": "2019-10-01T17:56:21", "url": "https://files.pythonhosted.org/packages/eb/50/169d3d0c246350da92e49665e388ad8218c47336bbe465275d018c5e57b0/userv-0.7.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2ea2b0d3485ae94c4083c266c9247ac4", "sha256": "9e381faa2a7734cdd6dfb436a604d30abdb2c1d44a854e993d54060be2ae5abb" }, "downloads": -1, "filename": "userv-0.7.1.tar.gz", "has_sig": false, "md5_digest": "2ea2b0d3485ae94c4083c266c9247ac4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8333, "upload_time": "2019-10-01T17:56:21", "url": "https://files.pythonhosted.org/packages/eb/50/169d3d0c246350da92e49665e388ad8218c47336bbe465275d018c5e57b0/userv-0.7.1.tar.gz" } ] }