Package: restiro
RESTiroRESTful API documentation generator (inline documentation + tests)FeaturesInline documentation parserExample recorder middlewareGenerate documentation in MarkdownGenerate documentation in HTML
[restiro-spa-material]Installpip install restiroUsageDescribe the request in comments, e.g:controller/shelf.pyclassShelfController:defpost(self):"""@api {post} /shelf/:shelfId/book Add book into shelf@apiVersion 1@apiGroup Book@apiPermission Noneres@apiParam {String} title@apiParam {String} author@apiParam {DateTime} [publishDate]@apiDescriptionHere is some descriptionwith full support of markdown.- watch this!- and this!- there is a list!"""return[11,22,33]Attachrestiromiddleware to your WSGI/HTTP verifier
(currentlywebtestsupported), e.g:Your project tests initializer:fromrestiro.middlewares.webtestimportTestAppfromrestiroimportclean_examples_dirfrommy_projectimportwsgi_appclean_examples_dir()test_app=TestApp(wsgi_app)Define responses to capture, e.g:deftest_shelf(test_app):test_app.get('/shelf/100/book')test_app.delete('/shelf/121/book')test_app.doc=Truetest_app.post('/shelf/100/book',json={'title':'Harry Potter','author':'JK. Rowling'})test_app.doc=Truetest_app.post('/shelf/100/book',json={'title':'Harry Potter2'},status=400)Run testsBuild documentation$ restiro a_libraryResponse will be something like:shelf-{shelf_id}-book-post.md#  Add book into shelf
    
    ##`POST``/shelf/:shelfId/book`Here is some description
    with full support of markdown.-watch this!-and this!-there is a list!
    
    
    ## Parameters
    
    ### Form parameters
    
    Name | Type | Required | Default | Example | enum | Pattern | MinLength | MaxLength | Minimum | Maximum | Repeat | Description
    --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
    title | String |`True`|  |  |  |  |  |  |  |  |`False`| 
    author | String |`True`|  |  |  |  |  |  |  |  |`False`| 
    publishDate | DateTime |`False`|  |  |  |  |  |  |  |  |`False`| 
    
    ## Examples
    
    ### 200 OK
    
    #### Request:```POST /shelf/100/bookContent-Type: application/x-www-form-urlencoded``````title=Harry Potterauthor=JK. Rowling```#### Response:```Content-Type: application/json``````[11, 22, 33]```### 400 Bad Request, missed parameter`author`#### Request:```POST /shelf/100/bookContent-Type: application/x-www-form-urlencoded``````title=Harry Potter2```#### Response:```Content-Type: application/json``````{"message": "Missed parameter `author`"}```---CLIusage: restiro [-h] [-t TITLE] [-o OUTPUT] [-b BASE_URI]
               [-g {markdown,json,spa_material,mock}] [-l LOCALES]
               [--build-gettext [BUILD_GETTEXT]]
               src

Restiro Builder

positional arguments:
  src                   Project module name

optional arguments:
  -h, --help            show this help message and exit
  -t TITLE, --title TITLE
                        Project title
  -o OUTPUT, --output OUTPUT
                        Output directory
  -b BASE_URI, --base-uri BASE_URI
                        Base URI
  -g {markdown,json,spa_material,mock}, --generator {markdown,json,spa_material,mock}
                        Generator, default: markdown
  -l LOCALES, --locales LOCALES
                        Locales directory
  --build-gettext [BUILD_GETTEXT]
                        Build .POT templates