From d6f0878555f397149ea28588413f20ec0fb10fba Mon Sep 17 00:00:00 2001 From: Josue Kouka Date: Fri, 21 Aug 2015 09:17:23 +0200 Subject: [PATCH] updating documentation --- README.md | 10 +++++----- README.rst | 12 ++++++------ docs/index.md | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8bb6ff0..b923789 100755 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The response format is by default ***json***. >>> import myql >>> from myql.utils import pretty_json, pretty_xml >>> yql = myql.MYQL(format='xml', community=True) ->>> resp = yql.rawQuery('select name, woeid from geo.states where place="Congo"') +>>> resp = yql.raw_query('select name, woeid from geo.states where place="Congo"') >>> print(pretty_xml(resp.content)) @@ -113,7 +113,7 @@ The response format is by default ***json***. ->>> resp = yql.rawQuery('select name, woeid from geo.states where place="Congo"', format='json') +>>> resp = yql.raw_query('select name, woeid from geo.states where place="Congo"', format='json') >>> print(pretty_json(resp.content)) { "query": { @@ -245,12 +245,12 @@ Returns table description >>> ``` -####rawQuery(query) +####raw_query(query) Allows you to directly type your query ```python ->>> response = yql.rawQuery("select * from geo.countries where place='North America'") +>>> response = yql.raw_query("select * from geo.countries where place='North America'") >>> # deal with the response ``` @@ -399,7 +399,7 @@ Delete records >>> oauth = OAuth1(None, None, from_file='credentials.json') # only consumer_key and consumer_secret are required. >>> from myql import MYQL >>> yql = MYQL(format='xml', oauth=oauth) ->>> response = yql.getGUID('josue_brunel') # Deal with the response +>>> response = yql.get_guid('josue_brunel') # Deal with the response ``` #### Stocks Scraper diff --git a/README.rst b/README.rst index fd727b2..3fab26d 100644 --- a/README.rst +++ b/README.rst @@ -63,13 +63,13 @@ Disable access to community tables .. code:: python - >>> rep = yql.rawQuery('desc yahoo.finance.quotes ') + >>> rep = yql.raw_query('desc yahoo.finance.quotes ') >>> rep.json() {u'query': {u'count': 1, u'lang': u'en-US', u'results': {u'table': {u'src': u'http://www.datatables.org/yahoo/finance/yahoo.finance.quotes.xml', u'hash': u'061616a1c033ae89aaf2cbe83790b979', u'name': u'yahoo.finance.quotes', u'request': {u'select': {u'key': {u'required': u'true', u'type': u'xs:string', u'name': u'symbol'}}}, u'meta': {u'sampleQuery': u'\n\t\t\tselect * from yahoo.finance.quotes where symbol in ("YHOO","AAPL","GOOG","MSFT")\n\t\t'}, u'security': u'ANY'}}, u'created': u'2014-08-24T11:26:48Z'}} >>> >>> yql.community= True # Setting up access to community >>> yql = myql.MYQL() - >>> rep = yql.rawQuery('desc yahoo.finance.quotes ') + >>> rep = yql.raw_query('desc yahoo.finance.quotes ') >>> rep.json() {u'error': {u'lang': u'en-US', u'description': u'No definition found for Table yahoo.finance.quotes'}} @@ -90,10 +90,10 @@ The response format is by default ***json***. >>> import myql >>> yql = myql.MYQL(format='xml', community=True) - >>> rep = yql.rawQuery('select name, woeid from geo.states where place="Congo"') + >>> rep = yql.raw_query('select name, woeid from geo.states where place="Congo"') >>> rep.text u'\nCuvette-Ouest Department55998384Cuvette Department2344968Plateaux District2344973Sangha2344974Lekoumou2344970Pool Department2344975Likouala Department2344971Niari Department2344972Brazzaville2344976Bouenza Department2344967Kouilou2344969\n\n' - >>> rep = yql.rawQuery('select name, woeid from geo.states where place="Congo"', format='json') + >>> rep = yql.raw_query('select name, woeid from geo.states where place="Congo"', format='json') >>> rep.json() {u'query': {u'count': 11, u'lang': u'en-US', u'results': {u'place': [{u'woeid': u'55998384', u'name': u'Cuvette-Ouest Department'}, {u'woeid': u'2344968', u'name': u'Cuvette Department'}, {u'woeid': u'2344973', u'name': u'Plateaux District'}, {u'woeid': u'2344974', u'name': u'Sangha'}, {u'woeid': u'2344970', u'name': u'Lekoumou'}, {u'woeid': u'2344975', u'name': u'Pool Department'}, {u'woeid': u'2344971', u'name': u'Likouala Department'}, {u'woeid': u'2344972', u'name': u'Niari Department'}, {u'woeid': u'2344976', u'name': u'Brazzaville'}, {u'woeid': u'2344967', u'name': u'Bouenza Department'}, {u'woeid': u'2344969', u'name': u'Kouilou'}]}, u'created': u'2014-08-27T04:52:38Z'}} >>> @@ -122,14 +122,14 @@ Returns table description {u'query': {u'count': 1, u'lang': u'en-US', u'results': {u'table': {u'request': {u'select': [{u'key': [{u'required': u'true', u'type': u'xs:string', u'name': u'location'}, {u'type': u'xs:string', u'name': u'u'}]}, {u'key': [{u'required': u'true', u'type': u'xs:string', u'name': u'woeid'}, {u'type': u'xs:string', u'name': u'u'}]}]}, u'security': u'ANY', u'meta': {u'documentationURL': u'http://developer.yahoo.com/weather/', u'sampleQuery': u'select * from weather.forecast where woeid=2502265', u'description': u'Weather forecast table', u'author': u'Yahoo! Inc'}, u'hash': u'aae78b1462a6a8fbc748aec4cf292767', u'name': u'weather.forecast'}}, u'created': u'2014-08-16T19:31:51Z'}} >>> -rawQuery(query) +raw_query(query) ^^^^^^^^^^^^^^^ Allows you to directly type your query .. code:: python - >>> response = yql.rawQuery("select * from geo.countries where place='North America'") + >>> response = yql.raw_query("select * from geo.countries where place='North America'") >>> # deal with the response select(table, fields, limit).where(filters, ...) diff --git a/docs/index.md b/docs/index.md index 49ce8bd..5d9fcab 100644 --- a/docs/index.md +++ b/docs/index.md @@ -39,7 +39,7 @@ The response format is by default ***json***. >>> import myql >>> from myql.utils import pretty_json, pretty_xml >>> yql = myql.MYQL(format='xml', community=True) ->>> resp = yql.rawQuery('select name, woeid from geo.states where place="Congo"') +>>> resp = yql.raw_query('select name, woeid from geo.states where place="Congo"') >>> print(pretty_xml(resp.content)) @@ -93,7 +93,7 @@ The response format is by default ***json***. ->>> resp = yql.rawQuery('select name, woeid from geo.states where place="Congo"', format='json') +>>> resp = yql.raw_query('select name, woeid from geo.states where place="Congo"', format='json') >>> print(pretty_json(resp.content)) { "query": { @@ -230,7 +230,7 @@ Returns table description Allows you to directly type your query ```python ->>> response = yql.rawQuery("select * from geo.countries where place='North America'") +>>> response = yql.raw_query("select * from geo.countries where place='North America'") >>> # deal with the response ``` @@ -379,7 +379,7 @@ Delete records >>> oauth = OAuth1(None, None, from_file='credentials.json') # only consumer_key and consumer_secret are required. >>> from myql import MYQL >>> yql = MYQL(format='xml', oauth=oauth) ->>> response = yql.getGUID('josue_brunel') # Deal with the response +>>> response = yql.get_guid('josue_brunel') # Deal with the response ``` ## Utils