Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed error in README and made request method more concise

  • Loading branch information...
commit 2d43cc615437a4d26b842f955c03d00932c782d0 1 parent 32a23f6
Eric Martin authored
Showing with 4 additions and 3 deletions.
  1. +2 −1  README.txt
  2. +2 −2 worldbank.py
3  README.txt
View
@@ -5,7 +5,8 @@ Example code:
from worldbank import Worldbank
-wb = Worldbank() #"lang" and "per_page" are allowed kwargs. Represents a connection to World Bank
+wb = WorldBank() #"lang" and "per_page" are allowed kwargs.
+Represents a connection to World Bank
brazil = wb.get_country(code='br') #gets general data on brazil from world bank
brazil_gdp = wb.get_country(code='br', indicator='NY.GDP.MKTP.CD') #GDP of Brazil in US dollars
indicators = wb.get_indicators() #a list of all the indicators
4 worldbank.py
View
@@ -86,7 +86,7 @@ def request(self, path, **kwargs):
'''Utility function that concatenates the URL and calls _fetch'''
kwargs['format'] = 'json'
- if not kwargs.get('per_page', False):
+ if 'per_page' not in kwargs:
kwargs['per_page'] = self.per_page
return _fetch(self.URL + self.lang + '/' + path + '?' +
- urllib.urlencode(kwargs))
+ urllib.urlencode(kwargs))
Please sign in to comment.
Something went wrong with that request. Please try again.