Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified to work with Yelp's API keys #8

Merged
merged 4 commits into from
Jan 28, 2018

Conversation

tamos
Copy link
Contributor

@tamos tamos commented Jan 27, 2018

Yelp is moving to API keys, I changed a few lines to reflect that.

@gfairchild
Copy link
Collaborator

gfairchild commented Jan 28, 2018

This is great! A couple of requests to complete this PR:

  • Would you mind updating requirements.txt? requests-oauth and oauthlib (and any dependencies they have) should no longer be necessary with this change.
  • Would you mind updating CHANGES.md to reflect this change? Let's bump the version to 2.2.0.
  • Would you mind updating setup.py:28 to state version 2.2.0?

Copy link
Collaborator

@gfairchild gfairchild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple minor formatting changes.

@@ -21,8 +21,8 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

from requests_oauthlib import OAuth2Session
from oauthlib.oauth2 import BackendApplicationClient

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind deleting this line?

self._yelp_session = OAuth2Session(client=BackendApplicationClient(client_id=client_id))
self._yelp_session.fetch_token(token_url=ACCESS_TOKEN_URL, client_id=client_id, client_secret=client_secret)
def __init__(self, api_key):
''' Instantiate a YelpAPI object.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind formatting these docstrings like the other docstrings in this project? That is, use double-quotes, space/indent as seen elsewhere.

@tamos
Copy link
Contributor Author

tamos commented Jan 28, 2018

Hi Geoff - thanks for the pointers. It's my first pull so I'm still learning.

I think I got all the points, let me know if I missed anything. I'm planning to use this package for a group project for my MA program, so thank-you for writing this and making our work easier!

  • Ty

@gfairchild
Copy link
Collaborator

Thank you! I'm glad Yelp is moving away from OAuth. Their implementation is wonky and led to issues like #4.

One last thing - would you mind updating examples/examples.py? Should just require modifying lines 13, 14, and 17. I want to eventually convert those into unit tests (see #3).

@tamos
Copy link
Contributor Author

tamos commented Jan 28, 2018

Just updated examples.py. I'm not too familiar with argparse, so hopefully that's all OK.

@gfairchild
Copy link
Collaborator

Looks good to me! Merging your code now. I'll update PyPI this afternoon/evening.

@gfairchild gfairchild merged commit 15797c1 into lanl:master Jan 28, 2018
@gfairchild
Copy link
Collaborator

This is now live on PyPI (v2.2.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants