Home > python-yql

python-yql

Python-yql is a project mainly written in ..., it's free.

Simple command line YQL executor

Example output

$ ./yql
YQL endpoint http://query.yahooapis.com/v1/public/yql

YQL statements may be on multiple lines.
End your YQL statements with `;' to have the executed.
Send EOF (Unix: Control-D DOS: Control-Z) to quit.

> show tables;
table:
['answers.getbycategory',
 'answers.getbyuser',
 'answers.getquestion',
 'answers.search',
 {'content': 'appdb.application', 'security': 'APP'},
 {'content': 'appdb.application.scopes', 'security': 'APP'},
 'appdb.categories',
 {'content': 'appdb.developer', 'security': 'APP'},
 'appdb.search',
 {'content': 'appdb.user.recent', 'security': 'USER'},
 'atom',
 'avatars.get',
 'csv',
 'data.uri',
 {'content': 'fantasysports.draftresults', 'security': 'USER'},
 {'content': 'fantasysports.games', 'security': 'USER'},
 {'content': 'fantasysports.leagues', 'security': 'USER'},
 {'content': 'fantasysports.leagues.scoreboard', 'security': 'USER'},
 {'content': 'fantasysports.leagues.settings', 'security': 'USER'},
 {'content': 'fantasysports.leagues.standings', 'security': 'USER'},
 {'content': 'fantasysports.players', 'security': 'USER'},
 {'content': 'fantasysports.players.ownership', 'security': 'USER'},
 {'content': 'fantasysports.players.stats', 'security': 'USER'},
 {'content': 'fantasysports.teams', 'security': 'USER'},
 {'content': 'fantasysports.teams.roster', 'security': 'USER'},
 {'content': 'fantasysports.teams.roster.stats', 'security': 'USER'},
 {'content': 'fantasysports.teams.stats', 'security': 'USER'},
 'feed',
 'feednormalizer',
 'flickr.groups.info',
 'flickr.groups.pools.photos',
 'flickr.people.findbyusername',
 'flickr.people.info2',
 'flickr.people.publicphotos',
 'flickr.photos.exif',
 'flickr.photos.info',
 'flickr.photos.interestingness',
 'flickr.photos.recent',
 'flickr.photos.search',
 'flickr.photos.sizes',
 'flickr.photosets.info',
 'flickr.photosets.photos',
 'flickr.places',
 'flickr.places.info',
 'flickr.urls.lookupuser',
 'geo.concordance',
 'geo.continents',
 'geo.counties',
 'geo.countries',
 'geo.districts',
 'geo.oceans',
 'geo.placefinder',
 'geo.placemaker',
 'geo.places',
 'geo.places.ancestors',
 'geo.places.belongtos',
 'geo.places.children',
 'geo.places.common',
 'geo.places.descendants',
 'geo.places.neighbors',
 'geo.places.parent',
 'geo.places.siblings',
 'geo.placetypes',
 'geo.seas',
 'geo.states',
 'html',
 'json',
 'local.search',
 'maps.map',
 'maps.traffic',
 'meme.followers',
 'meme.following',
 'meme.functions',
 'meme.info',
 'meme.memes',
 'meme.people',
 'meme.popular',
 'meme.post.info',
 'meme.posts',
 'meme.posts.featured',
 'meme.recommended',
 'meme.search',
 'meme.shortener',
 {'content': 'meme.user.comments', 'security': 'USER'},
 {'content': 'meme.user.dashboard', 'security': 'USER'},
 {'content': 'meme.user.following', 'security': 'USER'},
 {'content': 'meme.user.posts', 'security': 'USER'},
 'microformats',
 'music.artist.id',
 'music.artist.popular',
 'music.artist.search',
 'music.artist.similar',
 'music.release.artist',
 'music.release.id',
 'music.release.popular',
 'music.release.search',
 'music.track.id',
 'music.track.popular',
 'music.track.search',
 'music.video.category',
 'music.video.id',
 'music.video.popular',
 'music.video.search',
 'music.video.similar',
 'mybloglog.community.find',
 'mybloglog.member',
 'mybloglog.member.contacts',
 'mybloglog.member.newwithcontacts',
 'mybloglog.member.newwithme',
 'mybloglog.members.find',
 {'content': 'mybloglog.stats.find', 'security': 'APP'},
 'ocp-sanitize',
 'rss',
 'search.images',
 'search.news',
 'search.siteexplorer.inlinks',
 'search.siteexplorer.pages',
 'search.spelling',
 'search.suggest',
 'search.termextract',
 'search.web',
 {'content': 'social.connections', 'security': 'USER'},
 {'content': 'social.connections.updates', 'security': 'APP'},
 {'content': 'social.contacts', 'security': 'USER'},
 {'content': 'social.contacts.connections', 'security': 'USER'},
 {'content': 'social.contacts.sync', 'security': 'USER'},
 {'content': 'social.contacts.updates', 'security': 'USER'},
 {'content': 'social.entities', 'security': 'APP'},
 {'content': 'social.favorites', 'security': 'USER'},
 {'content': 'social.notifications', 'security': 'USER'},
 {'content': 'social.notifications.summary', 'security': 'APP'},
 {'content': 'social.presence', 'security': 'APP'},
 {'content': 'social.profile', 'security': 'APP'},
 {'content': 'social.profile.image', 'security': 'APP'},
 {'content': 'social.profile.status', 'security': 'APP'},
 {'content': 'social.relationships', 'security': 'USER'},
 {'content': 'social.relationships.updates', 'security': 'APP'},
 {'content': 'social.updates', 'security': 'APP'},
 {'content': 'social.updates.activitystreams', 'security': 'APP'},
 {'content': 'social.updates.search', 'security': 'APP'},
 'upcoming.category',
 'upcoming.country',
 'upcoming.events',
 'upcoming.events.bestinplace',
 'upcoming.groups',
 'upcoming.metro',
 'upcoming.state',
 'upcoming.user',
 'upcoming.venue',
 'uritemplate',
 'weather.forecast',
 'xml',
 'xslt',
 'yahoo.coke',
 'yahoo.dht',
 {'content': 'yahoo.identity', 'security': 'APP'},
 'yahoo.memcache',
 'yahoo.shortener',
 'yahoo.ucsdata',
 'yahoo.urldb',
 'yahoo.y.ahoo.it',
 'yap.setsmallview',
 {'content': 'ymail.folders', 'security': 'USER'},
 {'content': 'ymail.messages', 'security': 'USER'},
 {'content': 'ymail.msgcontent', 'security': 'USER'},
 {'content': 'ymail.search', 'security': 'USER'},
 {'content': 'yql.env', 'security': 'APP'},
 {'content': 'yql.queries', 'security': 'USER'},
 {'content': 'yql.queries.query', 'security': 'USER'},
 'yql.query.multi',
 'yql.storage',
 'yql.storage.admin',
 'yql.table.desc',
 'yql.table.list',
 'yql.tables']
175 results returned
Time: Service: 0; User: 1; Exec: n/a
> select * from geo.places where text = 'united states';
place:
{'admin1': None,
 'admin2': None,
 'admin3': None,
 'areaRank': '14',
 'boundingBox': {'northEast': {'latitude': '71.441048',
                               'longitude': '-66.940643'},
                 'southWest': {'latitude': '18.911720',
                               'longitude': '-179.150558'}},
 'centroid': {'latitude': '37.167931', 'longitude': '-95.845016'},
 'country': {'code': 'US', 'content': 'United States', 'type': 'Country'},
 'lang': 'en-US',
 'locality1': None,
 'locality2': None,
 'name': 'United States',
 'placeTypeName': {'code': '12', 'content': 'Country'},
 'popRank': '0',
 'postal': None,
 'uri': 'http://where.yahooapis.com/v1/place/23424977',
 'woeid': '23424977'}
1 results returned
Time: Service: 124; User: 125; Exec: 124
> select *
>>> from geo.places
>>> where text = 'london';
place:
[{'admin1': {'code': 'GB-ENG', 'content': 'England', 'type': 'Country'},
  'admin2': {'code': 'GB-LND', 'content': 'Greater London', 'type': 'County'},
  'admin3': None,
  'areaRank': '7',
  'boundingBox': {'northEast': {'latitude': '51.686031',
                                'longitude': '0.280360'},
                  'southWest': {'latitude': '51.261318',
                                'longitude': '-0.563000'}},
  'centroid': {'latitude': '51.506321', 'longitude': '-0.127140'},
  'country': {'code': 'GB', 'content': 'United Kingdom', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '13',
  'postal': None,
  'uri': 'http://where.yahooapis.com/v1/place/44418',
  'woeid': '44418'},
 {'admin1': {'code': 'CA-ON', 'content': 'Ontario', 'type': 'Province'},
  'admin2': {'code': '', 'content': 'Middlesex', 'type': 'County'},
  'admin3': None,
  'areaRank': '6',
  'boundingBox': {'northEast': {'latitude': '43.073051',
                                'longitude': '-81.107582'},
                  'southWest': {'latitude': '42.824558',
                                'longitude': '-81.390648'}},
  'centroid': {'latitude': '42.986889', 'longitude': '-81.246208'},
  'country': {'code': 'CA', 'content': 'Canada', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '11',
  'postal': None,
  'uri': 'http://where.yahooapis.com/v1/place/4063',
  'woeid': '4063'},
 {'admin1': {'code': 'US-KY', 'content': 'Kentucky', 'type': 'State'},
  'admin2': {'code': '', 'content': 'Laurel', 'type': 'County'},
  'admin3': None,
  'areaRank': '3',
  'boundingBox': {'northEast': {'latitude': '37.152210',
                                'longitude': '-84.038658'},
                  'southWest': {'latitude': '37.102821',
                                'longitude': '-84.126663'}},
  'centroid': {'latitude': '37.127171', 'longitude': '-84.083771'},
  'country': {'code': 'US', 'content': 'United States', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '8',
  'postal': None,
  'uri': 'http://where.yahooapis.com/v1/place/2441293',
  'woeid': '2441293'},
 {'admin1': {'code': 'US-TX', 'content': 'Texas', 'type': 'State'},
  'admin2': {'code': '', 'content': 'Kimble', 'type': 'County'},
  'admin3': None,
  'areaRank': '1',
  'boundingBox': {'northEast': {'latitude': '30.693800',
                                'longitude': '-99.555527'},
                  'southWest': {'latitude': '30.677750',
                                'longitude': '-99.574188'}},
  'centroid': {'latitude': '30.685770', 'longitude': '-99.564850'},
  'country': {'code': 'US', 'content': 'United States', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '8',
  'postal': {'content': '76854', 'type': 'Zip Code'},
  'uri': 'http://where.yahooapis.com/v1/place/2441291',
  'woeid': '2441291'},
 {'admin1': {'code': 'US-CA', 'content': 'California', 'type': 'State'},
  'admin2': {'code': '', 'content': 'Tulare', 'type': 'County'},
  'admin3': None,
  'areaRank': '1',
  'boundingBox': {'northEast': {'latitude': '36.482731',
                                'longitude': '-119.431328'},
                  'southWest': {'latitude': '36.467670',
                                'longitude': '-119.445732'}},
  'centroid': {'latitude': '36.475281', 'longitude': '-119.438530'},
  'country': {'code': 'US', 'content': 'United States', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '1',
  'postal': {'content': '93618', 'type': 'Zip Code'},
  'uri': 'http://where.yahooapis.com/v1/place/2441279',
  'woeid': '2441279'},
 {'admin1': {'code': 'US-OH', 'content': 'Ohio', 'type': 'State'},
  'admin2': {'code': '', 'content': 'Madison', 'type': 'County'},
  'admin3': None,
  'areaRank': '3',
  'boundingBox': {'northEast': {'latitude': '39.921780',
                                'longitude': '-83.393143'},
                  'southWest': {'latitude': '39.859211',
                                'longitude': '-83.478882'}},
  'centroid': {'latitude': '39.885960', 'longitude': '-83.448128'},
  'country': {'code': 'US', 'content': 'United States', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '8',
  'postal': {'content': '43140', 'type': 'Zip Code'},
  'uri': 'http://where.yahooapis.com/v1/place/2441292',
  'woeid': '2441292'},
 {'admin1': {'code': 'US-WV', 'content': 'West Virginia', 'type': 'State'},
  'admin2': {'code': '', 'content': 'Kanawha', 'type': 'County'},
  'admin3': None,
  'areaRank': '2',
  'boundingBox': {'northEast': {'latitude': '38.195419',
                                'longitude': '-81.334877'},
                  'southWest': {'latitude': '38.177238',
                                'longitude': '-81.358017'}},
  'centroid': {'latitude': '38.186329', 'longitude': '-81.346451'},
  'country': {'code': 'US', 'content': 'United States', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '1',
  'postal': {'content': '25126', 'type': 'Zip Code'},
  'uri': 'http://where.yahooapis.com/v1/place/2441289',
  'woeid': '2441289'},
 {'admin1': {'code': 'US-AR', 'content': 'Arkansas', 'type': 'State'},
  'admin2': {'code': '', 'content': 'Pope', 'type': 'County'},
  'admin3': None,
  'areaRank': '2',
  'boundingBox': {'northEast': {'latitude': '35.342129',
                                'longitude': '-93.187340'},
                  'southWest': {'latitude': '35.319279',
                                'longitude': '-93.267769'}},
  'centroid': {'latitude': '35.330799', 'longitude': '-93.253883'},
  'country': {'code': 'US', 'content': 'United States', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '1',
  'postal': {'content': '72847', 'type': 'Zip Code'},
  'uri': 'http://where.yahooapis.com/v1/place/2441278',
  'woeid': '2441278'},
 {'admin1': {'code': 'US-OR', 'content': 'Oregon', 'type': 'State'},
  'admin2': {'code': '', 'content': 'Lane', 'type': 'County'},
  'admin3': None,
  'areaRank': '0',
  'boundingBox': {'northEast': {'latitude': '43.639599',
                                'longitude': '-123.084770'},
                  'southWest': {'latitude': '43.630501',
                                'longitude': '-123.097328'}},
  'centroid': {'latitude': '43.635551', 'longitude': '-123.091049'},
  'country': {'code': 'US', 'content': 'United States', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '1',
  'postal': {'content': '97424', 'type': 'Zip Code'},
  'uri': 'http://where.yahooapis.com/v1/place/2441286',
  'woeid': '2441286'},
 {'admin1': {'code': 'US-MI', 'content': 'Michigan', 'type': 'State'},
  'admin2': {'code': '', 'content': 'Monroe', 'type': 'County'},
  'admin3': None,
  'areaRank': '2',
  'boundingBox': {'northEast': {'latitude': '42.029301',
                                'longitude': '-83.595573'},
                  'southWest': {'latitude': '42.011120',
                                'longitude': '-83.620049'}},
  'centroid': {'latitude': '42.020210', 'longitude': '-83.607811'},
  'country': {'code': 'US', 'content': 'United States', 'type': 'Country'},
  'lang': 'en-US',
  'locality1': {'content': 'London', 'type': 'Town'},
  'locality2': None,
  'name': 'London',
  'placeTypeName': {'code': '7', 'content': 'Town'},
  'popRank': '1',
  'postal': {'content': '48159', 'type': 'Zip Code'},
  'uri': 'http://where.yahooapis.com/v1/place/2441281',
  'woeid': '2441281'}]
10 results returned
Time: Service: 206; User: 207; Exec: 206
>