Skip to content

Commit

Permalink
Update to pycountry-convert==0.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
openp2pdesign committed Aug 22, 2018
1 parent 03c2216 commit b583844
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions makerlabs/fablabs_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from geojson import dumps, Feature, Point, FeatureCollection
from geopy.geocoders import Nominatim
import pycountry
from pycountry_convert import convert_country_alpha2_to_continent
from pycountry_convert import country_alpha2_to_continent_code
from time import sleep
import pandas as pd

Expand Down Expand Up @@ -108,7 +108,7 @@ def get_labs(format):
current_lab.slug = i["slug"]
current_lab.url = i["url"]

current_lab.continent = convert_country_alpha2_to_continent(i["country_code"].upper())
current_lab.continent = country_alpha2_to_continent_code(i["country_code"].upper())
current_country = pycountry.countries.get(alpha_2=i["country_code"].upper())
current_lab.country_code = current_country.alpha_3
current_lab.country = current_country.name
Expand Down
10 changes: 6 additions & 4 deletions makerlabs/repaircafe_org.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
from geojson import dumps, Feature, Point, FeatureCollection
from geopy.geocoders import Nominatim
import pycountry
from pycountry_convert import convert_country_alpha2_to_continent
from pycountry_convert import country_alpha2_to_continent_code
from time import sleep
from selenium import webdriver
from bs4 import BeautifulSoup
import requests
import pandas as pd

from utils import get_location


# Geocoding variable
geolocator = Nominatim()
Expand All @@ -43,9 +45,9 @@ def data_from_repaircafe_org():
"""Gets data from repaircafe_org."""

# Use Chrome as a browser
# browser = webdriver.Chrome()
browser = webdriver.Chrome()
# Use PhantomJS as a browser
browser = webdriver.PhantomJS('phantomjs')
browser = webdriver.PhantomJS('phantomjs')
browser.get("https://repaircafe.org/en/?s=Contact+the+local+organisers")
browser.maximize_window()

Expand Down Expand Up @@ -136,7 +138,7 @@ def get_labs(format):
# current_lab.postal_code = i["postal_code"]
#
#
# current_lab.continent = convert_country_alpha2_to_continent(i[
# current_lab.continent = country_alpha2_to_continent_code(i[
# "country_code"].upper())
# current_country = pycountry.countries.get(
# alpha_2=i["country_code"].upper())
Expand Down
2 changes: 1 addition & 1 deletion makerlabs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ py==1.5.2
pyasn1==0.2.3
pyasn1-modules==0.0.8
pycountry==17.5.14
pycountry-convert==0.6.6
pycountry-convert==0.7.2
pycparser==2.17
PyDispatcher==2.0.5
pyOpenSSL==16.2.0
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
"pycountry",
"pycountry_convert",
"incf.countryutils",
"selenium"
"selenium",
"chromedriver-installer"
],
version='0.21.2',
version='0.21.3',
description='A python library for accessing online data about Makerspaces, Fab Labs, Hackerspaces, TechShop...',
author='Massimo Menichinelli',
author_email='info@openp2pdesign.org',
Expand Down

0 comments on commit b583844

Please sign in to comment.