Permalink
Browse files

Yahoo! Social SDK for Python - inital github import

  • Loading branch information...
1 parent 2e03721 commit 6d48038d80c3f8a5916d20e1508748097fc130c2 @dustinwhittle dustinwhittle committed Jul 29, 2009
Showing with 16,246 additions and 0 deletions.
  1. +23 −0 LICENSE
  2. +110 −0 README
  3. 0 build/lib/oauthlib/__init__.py
  4. +594 −0 build/lib/oauthlib/oauth.py
  5. +55 −0 build/lib/openid/__init__.py
  6. +555 −0 build/lib/openid/association.py
  7. +219 −0 build/lib/openid/cryptutil.py
  8. +42 −0 build/lib/openid/dh.py
  9. +46 −0 build/lib/openid/extension.py
  10. +430 −0 build/lib/openid/fetchers.py
  11. +123 −0 build/lib/openid/kvform.py
  12. +631 −0 build/lib/openid/message.py
  13. +190 −0 build/lib/openid/oidutil.py
  14. +7 −0 build/lib/openid/sreg.py
  15. +202 −0 build/lib/openid/urinorm.py
  16. +221 −0 build/lib/simplejson/__init__.py
  17. +277 −0 build/lib/simplejson/decoder.py
  18. +301 −0 build/lib/simplejson/encoder.py
  19. +40 −0 build/lib/simplejson/jsonfilter.py
  20. +76 −0 build/lib/simplejson/scanner.py
  21. +74 −0 build/lib/yahoo/__init__.py
  22. +158 −0 build/lib/yahoo/application.py
  23. +182 −0 build/lib/yahoo/oauth.py
  24. +52 −0 build/lib/yahoo/yql.py
  25. +143 −0 examples/oauth_tokens.py
  26. +79 −0 examples/yql.py
  27. +17 −0 setup.py
  28. +21 −0 src/oauthlib/LICENSE
  29. 0 src/oauthlib/__init__.py
  30. +594 −0 src/oauthlib/oauth.py
  31. +202 −0 src/openid/LICENSE
  32. +55 −0 src/openid/__init__.py
  33. +555 −0 src/openid/association.py
  34. +6 −0 src/openid/consumer/__init__.py
  35. +1,899 −0 src/openid/consumer/consumer.py
  36. +463 −0 src/openid/consumer/discover.py
  37. +249 −0 src/openid/consumer/html_parse.py
  38. +219 −0 src/openid/cryptutil.py
  39. +42 −0 src/openid/dh.py
  40. +46 −0 src/openid/extension.py
  41. +3 −0 src/openid/extensions/__init__.py
  42. +55 −0 src/openid/extensions/oauth.py
  43. +277 −0 src/openid/extensions/pape.py
  44. +518 −0 src/openid/extensions/sreg.py
  45. +430 −0 src/openid/fetchers.py
  46. +123 −0 src/openid/kvform.py
  47. +631 −0 src/openid/message.py
  48. +190 −0 src/openid/oidutil.py
  49. +7 −0 src/openid/sreg.py
  50. +8 −0 src/openid/store/__init__.py
  51. +426 −0 src/openid/store/filestore.py
  52. +197 −0 src/openid/store/interface.py
  53. +125 −0 src/openid/store/memstore.py
  54. +98 −0 src/openid/store/nonce.py
  55. +516 −0 src/openid/store/sqlstore.py
  56. +202 −0 src/openid/urinorm.py
  57. +29 −0 src/openid/yadis/__init__.py
  58. +133 −0 src/openid/yadis/accept.py
  59. +13 −0 src/openid/yadis/constants.py
  60. +135 −0 src/openid/yadis/discover.py
  61. +300 −0 src/openid/yadis/etxrd.py
  62. +200 −0 src/openid/yadis/filters.py
  63. +194 −0 src/openid/yadis/manager.py
  64. +197 −0 src/openid/yadis/parsehtml.py
  65. +54 −0 src/openid/yadis/services.py
  66. +168 −0 src/openid/yadis/xri.py
  67. +123 −0 src/openid/yadis/xrires.py
  68. +19 −0 src/simplejson/LICENSE
  69. +221 −0 src/simplejson/__init__.py
  70. +277 −0 src/simplejson/decoder.py
  71. +301 −0 src/simplejson/encoder.py
  72. +40 −0 src/simplejson/jsonfilter.py
  73. +76 −0 src/simplejson/scanner.py
  74. +25 −0 src/yahoo/LICENSE
  75. +74 −0 src/yahoo/__init__.py
  76. +158 −0 src/yahoo/application.py
  77. +182 −0 src/yahoo/oauth.py
  78. +52 −0 src/yahoo/yql.py
  79. +28 −0 test/run_unit_tests.py
  80. +68 −0 test/unit/yahoo/test_application.py
  81. +138 −0 test/unit/yahoo/test_oauth.py
  82. +37 −0 test/unit/yahoo/test_yql.py
View
23 LICENSE
@@ -0,0 +1,23 @@
+Copyrights for code authored by Yahoo! Inc. is licensed under the following terms:
+
+MIT License
+
+Copyright (c) 2006-2009 Yahoo! Inc. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
110 README
@@ -0,0 +1,110 @@
+Yahoo! Python SDK
+=================
+
+ * Yahoo! Query Language
+ * Yahoo! Social API
+
+Find documentation and support on Yahoo! Developer Network: http://developer.yahoo.com
+
+Hosted on GitHub: http://github.com/yahoo/yos-social-python/tree/master
+
+## License
+
+@copyright: Copyrights for code authored by Yahoo! Inc. is licensed under the following terms:
+@license: BSD Open Source License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+The Yahoo! Social Python SDK code is subject to the MIT license, see the LICENSE file.
+
+
+## Requirements
+
+The following dependencies are bundled with the Yahoo! Python SDK, but are under
+terms of a separate license:
+
+ * SimpleJSON - http://code.google.com/p/simplejson
+ * OAuth - http://code.google.com/p/oauth
+ * OpenID - http://openidenabled.com/python-openid
+
+
+## Install
+
+Simply make sure that this app is on your PYTHON PATH. Maybe I'll add an installer later.
+Once it is in your PYTHON PATH then to use it in your project. The sdk also requires
+the oauth and simplejson modules, easy installed:
+
+ easy_install oauth simplejson
+
+
+## Examples in code
+
+Fetching YQL:
+-------------
+
+ import yahoo.yql
+
+ response = yahoo.yql.YQLQuery().execute('select * from delicious.feeds.popular')
+ if 'query' in response and 'results' in response['query']:
+ print response['query']['results']
+ elif 'error' in response:
+ print 'YQL query failed with error: "%s".' % response['error']['description']
+ else:
+ print 'YQL response malformed.'
+
+
+Fetching Social Data:
+---------------------
+
+ import yahoo.application
+
+ # Yahoo! OAuth Credentials - http://developer.yahoo.com/dashboard/
+
+ CONSUMER_KEY = '##'
+ CONSUMER_SECRET = '##'
+ APPLICATION_ID = '##'
+ CALLBACK_URL = '##'
+
+ oauthapp = yahoo.application.OAuthApplication(CONSUMER_KEY, CONSUMER_SECRET, APPLICATION_ID, CALLBACK_URL)
+
+ # Fetch request token
+ request_token = oauthapp.get_request_token()
+
+ # Redirect user to authorization url
+ redirect_url = oauthapp.get_authorization_url(request_token, CALLBACK_URL)
+
+ # Exchange request token for authorized access token
+ access_token = oauthapp.get_access_token(request_token)
+
+ # update access token
+ oauthapp.token = access_token
+
+ profile = oauthapp.getProfile()
+
+ print profile
+
+
+
+## Tests
+
+The Yahoo! Python SDK comes with a test suite to validate functionality. The tests also
+show functional examples and results. To run the test suite, simply execute the test suite:
+
+ python test/run_unit_tests.py
+
No changes.
Oops, something went wrong.

0 comments on commit 6d48038

Please sign in to comment.