From d9b5371b84dfced03909736d0d84256d22a9e9a1 Mon Sep 17 00:00:00 2001 From: josuebrunel Date: Sat, 16 Aug 2014 21:08:34 +0200 Subject: [PATCH] #1 documentation updates --- README.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/README.md b/README.md index a24409b..8575677 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,83 @@ lokingYQL ========= LokingYQL is a Yahoo Query Language Wrapper written in Python + +version +======= + +0.5 + +installation +============ + +Surely through ***pipe*** or something like + +```shell +$ python setup.py install +``` + +how to use +========== + +```python +>>> import lokingyql +>>> yql = lokingyql.LokingYQL() +>>> yql.diagnostics = True # To turn diagnostics on +``` + +# +Methods +------- + +* use() +------- + +Changes the data provider + +```python +>>> yql.use('http://myserver.com/mytables.xml') +``` + + +* rawQuery() +------------ + +Allows you to directly type your query + +```python +>>> response = yql.rawQuery("select * from geo.countries where place='North America'") +>>> # deal with the response +``` + +* select(table, fields).where(filters, ...) +----------------------- + +Select a table i.e *weather.forecast*. +If *table* not provided, it will use the default table. If there's no such thing as a default table, it will raise a *NoTableSelectedError* + +```python +>>> response = yql.select('geo.countries', [name, code, woeid]).where(['name', '=', 'Canada']) +>>> response.json() +{u'query': {u'count': 1, u'lang': u'en-US', u'results': {u'place': {u'woeid': u'23424775', u'name': u'Canada'}}, u'created': u'2014-08-16T19:04:08Z'}} +>>> ... +``` + +* create() +---------- + +* insert() +---------- + +* update() +---------- + +* delete() +---------- + +Voila + + + + + +