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

Updated RestCountryApi and RestCountryApiV2 BASE_URI #13

Merged
merged 2 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ python-restcountries
[![Coverage Status](https://coveralls.io/repos/github/SteinRobert/python-restcountries/badge.svg?branch=master)](https://coveralls.io/github/SteinRobert/python-restcountries?branch=master)
[![PyPI version](https://badge.fury.io/py/python-restcountries.svg)](https://badge.fury.io/py/python-restcountries)

This is a simple python wrapper for the API of [http://restcountries.eu](http://restcountries.eu).
This is a simple python wrapper for the API of [http://restcountries.com](http://restcountries.com).
If there are any issues, please use this repository to contact me about it.

Installation
Expand Down
9 changes: 2 additions & 7 deletions restcountries/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class RestCountryApi:
BASE_URI = "https://restcountries.eu/rest/v1"
BASE_URI = "https://restcountries.com/v1"
Copy link

Choose a reason for hiding this comment

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

just to let you know that V1 does not exists

Copy link
Owner

Choose a reason for hiding this comment

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

@amatosg thanks for letting us now. I guess we could remove the support for v1 then.

QUERY_SEPARATOR = ","

@classmethod
Expand Down Expand Up @@ -167,7 +167,7 @@ def get_countries_by_capital(cls, capital, filters=None):


class RestCountryApiV2(RestCountryApi):
BASE_URI = "https://restcountries.eu/rest/v2"
BASE_URI = "https://restcountries.com/v2"
QUERY_SEPARATOR = ";"


Expand Down Expand Up @@ -218,8 +218,3 @@ def __str__(self):

def __repr__(self):
return "<{} | {}>".format(self.name, self.alpha3_code)


# s = RestCountryApiV2()

# s.get_countries_by_country_codes(["ke", "ug"],filters=["name","capital","currencies"])