Skip to content

Commit

Permalink
#1: fixing merge
Browse files Browse the repository at this point in the history
  • Loading branch information
josuebrunel committed May 26, 2015
2 parents 20a4747 + 1256823 commit 7d7feb8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 54 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mYQL
[![Join the chat at https://gitter.im/josuebrunel/myql](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/josuebrunel/myql?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Code Issues](https://www.quantifiedcode.com/project/gh:josuebrunel:myql/badge.svg)](https://www.quantifiedcode.com/app/project/gh:josuebrunel:myql)


mYQL is a Python wrapper of the Yahoo Query Language.
mYQL is a Python wrapper of the Yahoo Query Language. Full documentation [here](http://myql.readthedocs.org/en/latest/)

Yahoo! Query Language Documentation and Support
===============================================
Expand Down Expand Up @@ -39,7 +39,7 @@ v 1.2.2 ( in development )

v 1.2.1
------
* Multiple requests while using OAuth fixed
* Multiple requests while using OAuth fixed

v 1.2.0
-------
Expand All @@ -53,7 +53,7 @@ v 0.5.6
* select data format (xml/json)
* change data source
* filter data
* fix handling of default and on the fly response format
* fix handling of default response format on the fly
* fix limit on ***select(...).where(...)*** when no limit value is passed
* fix limit on ***get(...)***

Expand Down
50 changes: 12 additions & 38 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
`MYQL <.>`_

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

  ** ` <.>`_

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

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

MYQL
mYQL
====

MYQL is a Python wrapper of the Yahoo Query Language.
mYQL is a Python wrapper of the Yahoo Query Language. Read the full Documentation `http://myql.readthedocs.org/en/latest/`

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 <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/>`_
Console <https://developer.yahoo.com/yql/console/>`__

Installation
============
Expand All @@ -36,16 +20,6 @@ Installation

$ pip install myql

::

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

Or download the package and run

::

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

Quick Start
===========

Expand Down Expand Up @@ -247,12 +221,12 @@ Using OAuth to fetch protected resources
>>> yql = MYQL(format='xml', oauth=oauth)
>>> response = yql.getGUID('josue_brunel') # Deal with the response

` <myql/>`_\ Next
` <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>`_.
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/>`_
GitHub `« Previous <>`__ `Next » <myql/>`__
6 changes: 1 addition & 5 deletions myql/myql.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
from myql.contrib.auth import YOAuth
import myql.errors

import importlib

__author__ = 'Josue Kouka'
__email__ = '[email protected]'

logging.basicConfig(level=logging.DEBUG,format="[%(asctime)s %(levelname)s] [%(name)s.%(module)s.%(funcName)s] %(message)s \n")
logger = logging.getLogger('mYQL')
Expand All @@ -28,7 +24,7 @@ class MYQL(object):
private_url = 'http://query.yahooapis.com/v1/yql'
community_data = "env 'store://datatables.org/alltableswithkeys'; " #Access to community table

def __init__(self, table=None, url=public_url, community=False, format='json', jsonCompact=False, crossProduct=None, debug=False, oauth=None):
def __init__(self, table=None, url=public_url, community=True, format='json', jsonCompact=False, crossProduct=None, debug=False, oauth=None):
self.table = table
self.format = format
self._query = None # used to build query when using methods such as <select>, <insert>, ...
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
from setuptools import setup, find_packages

__author__ = 'Josue Kouka'
__email__ = '[email protected]'
__version__ = "1.2.2"

#requirements.txt
Expand All @@ -11,12 +13,12 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
name = "mYQL",
name = "myql",
version = __version__,
description = "Python Wrapper for the Yahoo! Query Language. Allowing to run YQL queries, fetch financial data and create YQL Open Tables",
long_description = read("README.rst"),
author = "Josue Kouka",
author_email = "[email protected]",
author = __author__,
author_email = __email__,
url = "https://github.com/josuebrunel/MYQL",
download_url = "https://github.com/josuebrunel/myql/archive/{0}.tar.gz".format(__version__),
keywords = ['myql', 'yql', 'yahoo', 'query', 'language'],
Expand Down
9 changes: 4 additions & 5 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
readline.parse_and_bind('tab: complete')

logging.basicConfig(level=logging.DEBUG,format="[%(asctime)s %(levelname)s] [%(name)s.%(module)s.%(funcName)s] %(message)s \n")
logging.getLogger(__name__)
logging.getLogger('Test-mYQL')


def json_write_data(json_data, filename):
with open(filename, 'w') as fp:
#json.dump(json_data, fp, indent=4, encoding= 'utf-8', sort_keys=True)
json.dump(json_data, fp, indent=4, sort_keys=True, ensure_ascii=False)
return True
return False
Expand All @@ -34,14 +33,14 @@ def json_get_data(filename):
with open(filename, 'r') as fp:
json_data = json.load(fp)
return json_data


class TestMYQL(unittest.TestCase):

def setUp(self,):
self.yql = MYQL(format='json',community=True)
self.insert_result = None

def tearDown(self):
pass

Expand Down Expand Up @@ -110,7 +109,7 @@ def test_2_check_insert(self,):
except (Exception,) as e:
logging.error(response.content)
logging.error(e)

self.assertEqual(response.status_code,200)

def test_3_update(self,):
Expand Down

0 comments on commit 7d7feb8

Please sign in to comment.