Metadata-Version: 1.1
Name: restruct
Version: 0.2.0
Summary: Turn SQL results into beautiful JSON structures
Home-page: https://github.com/webheroesinc/restruct
Author: Matthew Brisebois
Author-email: matthew@webheroes.ca
License: Dual License; GPLv3 and Proprietary
Description: Restruct is an easy light-weight formatting library that simplifies the process of representing
        SQL results in a human readable format (JSON).  Pass the restruct method your SQL results and a
        formatting structure and voila, you have turned your complex SQL result into beautiful JSON.  One of
        the best features of Restruct is squashing all the duplicate entries from SQL joins into a sub
        section of your JSON structure.
        
        ===============
         Usage examples
        ===============
        
        *Lets assume we have an SQL join for a 1 to 1 relationship and that all the format variables used
        represent columns in the select tables.*
        
        ::
          
              SELECT user_id,
                     user_level,
                     level_name,
                     first_name,
                     last_name,
                     email
                FROM users
                JOIN user_levels USING (user_level_id)
        
        Formatting
        =============
        
        *An example format structure for results from the above query:*
        
        ::
        
            {
                ".single": true,
                ".key": "{user_id}",
                "id": ": {user_id}", 
                "level": {
                    "id": ": {user_level}", 
                    "name": ": {user_level_name}"
                },
                "name": {
                    "first": ":< first_name",
                    "last": ":< last_name", 
                    "full": "{first_name} {last_name}"
                },
                "email": true
            }
        
            
Keywords: mysql,sqlite,sql,json
Platform: UNKNOWN
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3.5
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
