Metadata-Version: 1.0
Name: uritemplate.py
Version: 0.0.1
Summary: URI templates
Home-page: https://uritemplate.readthedocs.org
Author: Ian Cordasco
Author-email: graffatcolmingov@gmail.com
License: Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are 
met:

1. Redistributions of source code must retain the above copyright 
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 
notice, this list of conditions and the following disclaimer in the 
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products 
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.

Description: uritemplate
        ===========
        
        Documentation_ -- GitHub_ -- BitBucket_
        
        Simple python library to deal with `URI Templates`_. The API should looks 
        like::
        
            from uritemplate import URITemplate, expand
        
            gist_uri = 'https://api.github.com/users/sigmavirus24/gists{/gist_id}'
            t = URITemplate(gist_uri)
            print(t.expand(gist_id=123456))
            # => https://api.github.com/users/sigmavirus24/gists/123456
        
            # or
            print(expand(gist_uri, gist_id=123456))
        
            # also
            t.expand({'gist_id': 123456})
            print(expand(gist_uri, {'gist_id': 123456}))
        
        Where it might be useful to have a class::
        
            import requests
        
            class GitHubUser(object):
                url = URITemplate('https://api.github.com/user{/login}')
                def __init__(self, name):
                    self.api_url = url.expand(login=name)
                    response = requests.get(self.api_url)
                    if response.status_code == 200:
                        self.__dict__.update(response.json())
        
        When the module containing this class is loaded, ``GitHubUser.url`` is 
        evaluated and so the template is created once. It's often hard to notice in 
        Python, but object creation can consume a great deal of time and so can the 
        ``re`` module which uritemplate relies on. Constructing the object once should 
        reduce the amount of time your code takes to run.
        
        License
        -------
        
        Modified BSD license_
        
        
        .. _Documentation: https://uritemplate.rtfd.org/
        .. _GitHub: https://github.com/sigmavirus24/uritemplate
        .. _BitBucket: https://bitbucket.org/icordasc/uritemplate
        .. _URI Templates: http://tools.ietf.org/html/rfc6570
        .. _license: ./LICENSE
        
        
        Changelog
        =========
        
        0.1.0 - 2013-05-xx
        ------------------
        
        - Initial Release
        
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: Implementation :: CPython
