This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

`|Build Status| <https:"" josuebrunel="" myql-cli="">`_
`|Documentation Status| <https:""/>`_

***MYQL-cli*** is a command line tool to run YQL queries or to generate
YQL OpenTable.



$ pip install myql-cli # Not available yet

How To


usage: YQL-cli tools [-h] [-v] {init-config,execute,shell,table} ...

positional arguments:
init-config Init a config file .myql-cli.ini in your home
execute Executes a YQL query
shell Prompts a YQL shell command
table Creates a YQL table

optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit

Config File

***myql-cli*** config file is located in ***~/.myql-cli.ini***.


$ ./ init-config


format = json # Default format
oauth = False # OAuth enabled

diagnostics = False
debug = False
jsoncompact = False

diagnostics = False
debug = False

from_file = None # Path to your credentials json file

**NB**: Your ***credentials*** file must at least have


"consumer_key":"your consumenr key",
"consumer_secret": "your consumer secret"

Query Tool


$ myql-cli execute -h
usage: YQL-cli tools execute [-h] [--format {json,xml}] [--pretty]
[--jsonCompact] [--diagnostics] [--debug]

positional arguments:
execute Execute a YQL query

optional arguments:
-h, --help show this help message and exit
--format {json,xml} Response returned format
--jsonCompact Json response compacted
--diagnostics Response with diagnostics
--debug Response with diagnostics

- ***json***

``shell $ myql-cli execute --format json "select * from geo.countries where name='Congo'"``
``json { "query": { "count": 1, "lang": "en-US", "results": { "place": { "lang": "en-US", "woeid": "23424779", "uri": "", "name": "Congo", "placeTypeName": { "content": "Country", "code": "12" } } }, "created": "2015-04-07T12:37:13Z" } }``

- ***xml***

``shell $ myql-cli execute --format xml "select * from geo.countries where name='Congo'"``
``xml <query xmlns:yahoo="" yahoo:count="1" yahoo:created="2015-04-07T12:36:44Z" yahoo:lang="en-US"> <results> <place xml:lang="en-US" xmlns="" yahoo:uri=""> <woeid>23424779</woeid> <placetypename code="12">Country</placetypename> <name>Congo</name> </place> </results> </query> ``

- ***xml + diagnostics***

``shell $ myql-cli execute --format xml --diagnostics "select * from geo.countries where name='Congo'"``
``xml <query xmlns:yahoo="" yahoo:count="1" yahoo:created="2015-04-07T12:38:43Z" yahoo:lang="en-US"> <diagnostics> <publiclycallable>true</publiclycallable> <url execution-start-time="2" execution-stop-time="71" execution-time="69"> </url> <user-time>74</user-time> <service-time>69</service-time> <build-version>0.2.75</build-version> </diagnostics> <results> <place xml:lang="en-US" xmlns="" yahoo:uri=""> <woeid>23424779</woeid> <placetypename code="12">Country</placetypename> <name>Congo</name> </place> </results> </query> ``

- ***json + diagnostics + debug***

``shell $ myql-cli execute --format json --diagnostices --debug "select * from geo.countries where name='Congo'"``
``json { "query": { "count": 1, "lang": "en-US", "diagnostics": { "url": [ { "content": "", "execution-stop-time": "5", "execution-start-time": "1", "execution-time": "4", "id": "3a511b18-0e52-405d-b804-803933d620eb" }, { "content": "", "execution-stop-time": "17", "execution-start-time": "7", "execution-time": "10", "id": "ddd7fc5d-b63d-4988-9437-fb678f781e46" }, { "content": "", "execution-stop-time": "53", "execution-start-time": "42", "execution-time": "11", "id": "43b945b6-b92a-4e74-a58c-9a7b597a8045" }, { "content": ";start=0;count=1000", "execution-stop-time": "156", "execution-start-time": "79", "execution-time": "77" } ], "user-time": "160", "build-version": "0.2.75", "service-time": "102", "publiclyCallable": "true" }, "results": { "place": { "lang": "en-US", "woeid": "23424779", "uri": "", "name": "Congo", "placeTypeName": { "content": "Country", "code": "12" } } }, "created": "2015-04-07T12:39:47Z" } }``

YQL Shell


$ myql-cli shell -h


$ myql-cli shell

Table Manager


$ myql-cli table -h
usage: YQL-cli tools table [-h] [-i] [-c] table

positional arguments:
table Create a YQL Table from python file

optional arguments:
-h, --help show this help message and exit
-i, --init Creates a project with a file in it
-c, --create Creates tables in the file of your project

- Initialize the table project


$ myql-cli table -i lol
$ ls -l lol

- Define your table


$ vim lol/


from myql.contrib.table import BinderModel, BinderKey, BinderPage, TableModel, BinderFrom

class SelectBinder(BinderModel):
name = 'select'
itemPath = 'products.product'
produces = 'xml'
pollingFrequencySeconds = 30
urls = ['{artist}','{song}']
paging = BinderPage('page', {'id': 'ItemPage', 'default': '1'}, {'id':'Count' ,'max':'25'},{'default': '10'})
artist = BinderKey(id='artist', type='xs:string', paramType='path')
song = BinderKey(id='song', type='xs:string', paramType='path', required='true')

class TestTable(TableModel):
name = 'Test'
author = 'Josue Kouka'
apiKeyURL = ''
documentationURL = ''
sampleQuery = ['SELECT * FROM mytable']
select = BinderFrom(SelectBinder)

- Generate your table in XML


$ myql-cli table --create lol
$ ls lol
Test.xml __init__.pyc tables.pyc


$ cat lol/Test.xml


<table https="false" securitylevel="any" xmlns="">
<author>Josue Kouka</author>
<samplequery>SELECT * FROM mytable</samplequery>
<select itempath="products.product" pollingfrequencyseconds="30" produces="xml">
<key id="song" paramtype="path" required="true" type="xs:string"/>
<key id="artist" paramtype="path" required="false" type="xs:string"/>
<paging model="page">
<start default="1" id="ItemPage"/>
<total default="10"/>
<pagesize id="Count" max="25"/>


.. |Build Status| image::
.. |Documentation
Status| image::
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
myql-cli-0.2.3.tar.gz (7.1 kB) Copy SHA256 Checksum SHA256 Source May 10, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting