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

Convert What3Words Geocoder to the v2 API. #226

Closed
wants to merge 3 commits into from

Conversation

jmb
Copy link
Contributor

@jmb jmb commented Oct 15, 2016

Also remove the OneWord functionality that has been deprecated by
What3Words.

Also remove the OneWord functionality that has been deprecated by
What3Words.
@jmb jmb mentioned this pull request Oct 15, 2016
@tym-xqo
Copy link

tym-xqo commented Nov 1, 2016

Note: what3words API v1 will no longer be available after November 30. It would be good to get this merged before then.

Copy link
Member

@KostyaEsmukov KostyaEsmukov left a comment

Choose a reason for hiding this comment

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

Thank you, this is really good! I've left some minor notes. Also this needs to be rebased: tests in master already don't have one-word addresses.

verified.
verified. As of API v2 only 'https' is supported - this parameter
remains for backwards compatibility (setting to 'http' will stop
this geocoder working).
Copy link
Member

Choose a reason for hiding this comment

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

I suggest to explicitly raise an exception in case http is passed.

if scheme == "http":
    raise ConfigurationError("What3Words doesn't support `http` scheme anymore. Please use `https` instead.")


if resources.get('error') == "11":
if 'code' in resources['status']:
raise exc.GeocoderQueryError(
Copy link
Member

Choose a reason for hiding this comment

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

Could you please raise GeocoderAuthenticationFailure here when resources['status']['code'] == 401?

And the same for reverse method below.

https://docs.what3words.com/api/v2/#errors

@KostyaEsmukov KostyaEsmukov added this to the 1.15 milestone May 7, 2018
@KostyaEsmukov
Copy link
Member

Merged in #303

@KostyaEsmukov
Copy link
Member

Thanks for this!

@tym-xqo
Copy link

tym-xqo commented Jun 13, 2018

Yowsah!

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.

None yet

3 participants