Skip to content

Commit

Permalink
#1 : might the right rst file
Browse files Browse the repository at this point in the history
  • Loading branch information
josuebrunel committed May 20, 2015
1 parent 6346fed commit a509f3d
Showing 1 changed file with 62 additions and 83 deletions.
145 changes: 62 additions & 83 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,89 +1,60 @@
`MYQL <.>`_

- `MYQL <myql/>`_
- `YOAuth <oauth/>`_
- `Open Table <table/>`_
- `Contribute <contrib/>`_

  ** ` <.>`_

- `Docs <.>`_ »
- Home
- `Edit on GitHub <https://github.com/josuebrunel/myql>`_

--------------

MYQL
====

` <https://travis-ci.org/josuebrunel/myql>`_ `|Documentation
Status| <https://myql.readthedocs.org>`_ `|Latest
Version| <https://pypi.python.org/pypi/myql/>`_
`|Downloads| <https://pypi.python.org/pypi/myql>`_
`|Status| <https://pypi.python.org/pypi/myql>`_
`|image4| <https://pypi.python.org/pypi/myql>`_ `|Join the chat at
https://gitter.im/josuebrunel/myql| <https://gitter.im/josuebrunel/myql?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge>`_
`|Code
Issues| <https://www.quantifiedcode.com/app/project/gh:josuebrunel:myql>`_

MYQL is a Python wrapper of the Yahoo Query Language.

Yahoo! Query Language Documentation and Support
===============================================

- Yahoo! Query Language - http://developer.yahoo.com/yql/
- Yahoo! Developer Network: http://developer.yahoo.com
- Yahoo! Application Platform - http://developer.yahoo.com/yap/
- Yahoo! Social APIs - http://developer.yahoo.com/social/
- Yahoo! QUery Language Console
https://developer.yahoo.com/yql/console/

Release Notes
=============

v 1.2.2 ( development )
-----------------------

- Fixed issue with **IN** condition in **where** clause
- Fixed issue when passing an empty list/tuple (**[]/()**) in a
**where** clause
- Import of StockParser from Gurchet Rai
https://github.com/gurch101/StockScraper OK
`#68 <https://github.com/josuebrunel/myql/issues/68>`_
- Insert, Update, Delete methods added
`#67 <https://github.com/josuebrunel/myql/issues/67>`_
- Dummy *try/except* removed from main module
- Fixed **Invalid OAuth Signature** when using a refreshed token
`#64 <https://github.com/josuebrunel/myql/issues/64>`_
- Fixed misused of ***MYQL.use(...)***
`#76 <https://github.com/josuebrunel/myql/issues/76>`_

v 1.2.1
-------
- `Yahoo! Query Language <http://developer.yahoo.com/yql/>`_
- `Yahoo! Developer Network <http://developer.yahoo.com>`_
- `Yahoo! Application Platform <http://developer.yahoo.com/yap/>`_
- `Yahoo! Social APIs <http://developer.yahoo.com/social/>`_
- `Yahoo! Query Language
Console <https://developer.yahoo.com/yql/console/>`_

- Multiple requests while using OAuth fixed
Installation
============

v 1.2.0
-------
::

- OpenTable classes
- Access to resources requiring authentication
$ pip install myql

v 0.5.6
-------
::

- fetch data
- access to community data
- select data format (xml/json)
- change data source
- filter data
- fix handling of default and on the fly response format
- fix limit on ***select(...).where(...)*** when no limit value is
passed
- fix limit on ***get(...)***

installation
============
$ pip install git+https://github.com/josuebrunel/myql.git

Or download the package and run

::

$ pip install myql
$ python setup.py install --record files_path.txt

how to use
==========
Quick Start
===========

::

>>> import myql
>>> yql = myql.MYQL()
>>> yql.diagnostics = True # To turn diagnostics on

access to community tables
Access to community tables
^^^^^^^^^^^^^^^^^^^^^^^^^^

::
Expand All @@ -98,15 +69,15 @@ access to community tables
{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'}}
>>>

***OR***
or

::

>>> import myql
>>> yql = myql.MYQL(community=True)
>>> # do your magic

changing response format (xml or json)
Changing response format (xml or json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The response format is by default ***json***.
Expand All @@ -126,8 +97,8 @@ The response format is by default ***json***.
Methods
-------

use(yql\_table\_url,name=yql\_table\_name )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
use(yql\_table\_url,name=yql\_table\_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Changes the data provider

Expand Down Expand Up @@ -193,7 +164,7 @@ instead .

::

>>> rep = yql.get('geo.countries', ['name', 'woeid'], 1)
>>> yql.get('geo.countries', ['name', 'woeid'], 1)
>>> rep.json()
{u'query': {u'count': 1, u'lang': u'en-US', u'results': {u'place': {u'woeid': u'23424966', u'name': u'Sao Tome and Principe'}}, u'created': u'2014-08-17T10:32:25Z'}}
>>>
Expand Down Expand Up @@ -247,13 +218,22 @@ Update fields values. This method **is always followed by
delete(table).where(filters, ...)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Delete records \`\`\`python >>> response =
self.yql.delete('yql.storage').where(['name','=','store://Rqb5fbQyDvrfHJiClWnZ6q'])
>>> response.json() # result prettyfied just for the example { "query":
{ "count": 1, "created": "2015-05-14T13:38:28Z", "lang": "en-US",
"results": { "success": "store://Rqb5fbQyDvrfHJiClWnZ6q deleted" } } }
Delete records

\`\`\`
::

>>> response = self.yql.delete('yql.storage').where(['name','=','store://Rqb5fbQyDvrfHJiClWnZ6q'])
>>> response.json() # result prettyfied just for the example
{
"query": {
"count": 1,
"created": "2015-05-14T13:38:28Z",
"lang": "en-US",
"results": {
"success": "store://Rqb5fbQyDvrfHJiClWnZ6q deleted"
}
}
}

Using OAuth to fetch protected resources
========================================
Expand All @@ -266,13 +246,12 @@ Using OAuth to fetch protected resources
>>> yql = MYQL(format='xml', oauth=oauth)
>>> response = yql.getGUID('josue_brunel') # Deal with the response

.. |Documentation
Status| image:: https://readthedocs.org/projects/myql/badge/?version=latest
.. |Latest Version| image:: https://pypip.in/version/myql/badge.svg
.. |Downloads| image:: https://pypip.in/download/myql/badge.svg
.. |Status| image:: https://pypip.in/py_versions/myql/badge.svg
.. |image4| image:: https://pypip.in/implementation/myql/badge.svg
.. |Join the chat at
https://gitter.im/josuebrunel/myql| image:: https://badges.gitter.im/Join%20Chat.svg
.. |Code
Issues| image:: https://www.quantifiedcode.com/project/gh:josuebrunel:myql/badge.svg
` <myql/>`_\ Next

--------------

Built with `MkDocs <http://www.mkdocs.org>`_ using a
`theme <https://github.com/snide/sphinx_rtd_theme>`_ provided by `Read
the Docs <https://readthedocs.org>`_.

GitHub `« Previous <>`_ `Next » <myql/>`_

0 comments on commit a509f3d

Please sign in to comment.