Metadata-Version: 1.0
Name: Ariane
Version: 0.0.5
Summary: Ariane is a python package for describing, producing and visualizing RESTful APIs
Home-page: https://github.com/guillaumevincent/Ariane
Author: Guillaume Vincent
Author-email: vincent.guillaume.inp@gmail.com
License: wtfpl - Do what the fuck you want to public license
Description: ======
        Ariane
        ======
        
        Ariane is a python package for describing, producing and visualizing RESTful APIs.
        It can help you create a Rest Api object that you can use with any template engine in python (Django, Jinja2).
        Or you can create an automatic documentation and use the templates provided by the community and automate the generation of the documentation for your API.
        
            #!/usr/bin/env python
        
            from ariane import ariane
        
            doc = ariane.Documentation("api_documentation.txt")
            print doc.__dict__
            restApiDoc.generate('documentation.html', 'template.html')
        
        
        Installation
        ============
        
            Ariane is a python package. You can install it with pip:
            pip install ariane
        
        more information: https://pypi.python.org/pypi/Ariane
        
        Overview
        =========
        
        your api_documentation.txt looks like a config file
        
        
        [api]
        name : Ariane Api Description
        version : 1.0.0
        base_url : http://localhost:9999/api/
        
        [code_status]
        400 : Bad input parameter. Error message should indicate which one and why.
        401 : Bad or expired token. This can happen if the user or Ariane revoked or expired an access token. To fix, you should re-authenticate the user.
        403 : Bad OAuth request (wrong consumer key, bad nonce, expired timestamp...). Unfortunately, re-authenticating the user won't help here.
        404 : File or folder not found at the specified path.
        405 : Request method not expected (generally should be GET or POST).
        503 : Your app is making too many requests and is being rate limited. 503s can trigger on a per-app or per-user basis.
        5xx : Server error.
        
        [auth:GET]
        url : /auth/logout/
        description : clear an existing cookie in the session
        input :
        return :
        
        [auth:POST]
        url : /auth/login/
        description : create a cookie in the session
        input :
            {
                "username": "",
                "password": ""
            }
        return :
            HTTP/1.1 200 OK
            Content-Length: 0
            Content-Type: text/html; charset=UTF-8
            Server: TornadoServer/2.4.1
            Set-Cookie: user="ImFkbUluIg==|9364473586|0ef6536217a330f6574831ed672666ca0eaaeab4"; expires=Sat, 27 Apr 2013 12:26:27 GMT; Path=/
        
        Tutorial
        ========
        
        1. create your api description file (api_documentation.txt)
        All information in this file is saved in sections. A section is shown with brackets
            [section]
        
        All resources are describe is section too. You must add the HTML verbs after two points in section
            [resource:HTML_VERB]
        example:
            [dog:POST]
        describe the POST method on dog resource
        you can add all the information you want under resources section (except name):
        
            [dog:POST]
            url : dog/
            input :
                {
                    "username": "",
                    "password": ""
                }
            info : 嶺
        
        2. Get all the information about resources in Documentation object:
        
            from ariane import ariane
            doc = ariane.Documentation("api_documentation.txt")
            print doc.__dict__
            print doc.resources
        
        return
        
            {
                'is_valid': True,
                'error_message': '',
                'resources': [
                    {
                        u'url': u'dog/',
                        u'input': u'\n{
                            \n"username": "",
                            \n"password": ""\n
                        }',
                        u'info': u'\u5dba',
                        'method': u'POST',
                        'name': u'dog'
                    }
                ],
                'status_code': 200
            }
        
        3. handle errors
            from ariane import ariane
            doc = ariane.Documentation("unknown_file.txt")
            if not doc.is_valid():
                print doc.status_code, doc.is_valid, doc.error_message
        
        
        History
        =========
        
        Ariane is the french translation for Ariadne
        Ariadne in Greek mythology, was the daughter of Minos king of Crete. She is mostly associated with mazes and labyrinths, due to her involvement in the myths of the Minotaur and Theseus.
        "Un fil d'Ariane" (Ariadne's String) is a french common name for a distance line, penetration line or guideline used by SCUBA divers.
        Ariadne's String is a string that helps guide someone through the Labyrinth of the Minotaur.
        
        Python Ariane package helps to understand your API, and helps you to offer a good documentation for your Restful API.
        
        
        License
        =========
        Ariane's License is the WTFPL – Do What the Fuck You Want to Public License.
        
                DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
        TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
        
        0. You just DO WHAT THE FUCK YOU WANT TO.
        
        
        
        
Platform: UNKNOWN
