aboutsummaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2013-05-11 14:44:11 -0400
committerIan Cordasco <graffatcolmingov@gmail.com>2013-05-11 14:44:11 -0400
commit39af7fd846ead9965dc56b000e555294535cc5de (patch)
treed7d07d259b7852650931ea952efa7882970a7e5b /README.rst
parent05dad4aaffe710759bd74fac6860f70e1569cdf9 (diff)
downloaduritemplates-39af7fd846ead9965dc56b000e555294535cc5de.tar.gz
Fix README
Totally forgot to update it when I updated the API
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst17
1 files changed, 7 insertions, 10 deletions
diff --git a/README.rst b/README.rst
index 94fa671..741a540 100644
--- a/README.rst
+++ b/README.rst
@@ -4,21 +4,18 @@ uritemplate
Simple python library to deal with `URI Templates`_. When complete the API
should look something like::
- from uritemplate import Template, expand
+ from uritemplate import URITemplate, expand
- t = Template('https://api.github.com/users/sigmavirus24/gists{/gist_id}')
+ 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(
- 'https://api.github.com/users/sigmavirus24/gists{/gist_id}',
- gist_id=123456
- ))
+ print(expand(gist_uri, gist_id=123456))
- # And possibly
- t = Template('https://api.github.com/users/sigmavirus24/gists{/gist_id}')
- t.gist_id = 123456
- print(t.expand())
+ # also
+ t.expand({'gist_id': 123456})
+ expand(gist_uri, {'gist_id': 123456})
.. _URI Templates: http://tools.ietf.org/html/rfc6570