Autor: Antonio de Jesus Anaya Hernandez, DevOps eng. for the IoPA.
Autor: The internet of Production Alliance, 2023.
Data was collected by "Fab Foundation", location: https://api.fablabs.io/0/labs.json
The Open Know Where (OKW) Standard is part of the Internet of Production Alliance and its members.
License: CC BY SA
Python code used to download, parse, filter, sort and map the data:
import folium
from folium.plugins import HeatMap
import requests
import pandas as pd
import matplotlib.pyplot as plt
url = "https://api.fablabs.io/0/labs.json"
response = requests.get(url)
data = response.json()
df = pd.DataFrame(data)
df = df[df['activity_status'] == 'active']
df = df.drop(columns=['id', 'kind_name', 'parent_id', 'blurb', 'description', 'slug', 'avatar_url', 'header_url'])
european_countries = {
'AT': 'Austria',
'BE': 'Belgium',
'BG': 'Bulgaria',
'CY': 'Cyprus',
'CZ': 'Czech Republic',
'DK': 'Denmark',
'EE': 'Estonia',
'FI': 'Finland',
'FR': 'France',
'DE': 'Germany',
'GR': 'Greece',
'HU': 'Hungary',
'IS': 'Iceland',
'IE': 'Ireland',
'IT': 'Italy',
'LV': 'Latvia',
'LI': 'Liechtenstein',
'LT': 'Lithuania',
'LU': 'Luxembourg',
'MT': 'Malta',
'MC': 'Monaco',
'NL': 'Netherlands',
'NO': 'Norway',
'PL': 'Poland',
'PT': 'Portugal',
'RO': 'Romania',
'SK': 'Slovakia',
'SI': 'Slovenia',
'ES': 'Spain',
'SE': 'Sweden',
'CH': 'Switzerland',
'GB': 'United Kingdom',
'VA': 'Vatican City'
}
europe_codes = european_countries.keys()
df = df[df['country_code'].isin(europe_codes)]
df = df[df['phone'].notna() & df['email'].notna() & (df['phone'] != '') & (df['email'] != '')]
df = df[df['latitude'].notna() & df['longitude'].notna() & (df['latitude'] != '') & (df['longitude'] != '')]
df.to_csv('make_european_countries.csv', index=False)
avg_lat = df['latitude'].mean()
avg_lon = df['longitude'].mean()
map = folium.Map(location=[avg_lat, avg_lon], zoom_start=3)
HeatMap(data=df[['latitude', 'longitude']].values, radius=8, max_zoom=8).add_to(map)
<folium.plugins.heat_map.HeatMap at 0x265d499fb20>
map
df['country_name'] = df['country_code'].map(european_countries)
result = df.groupby('country_name').size().sort_values(ascending=True)
result.plot(kind='barh', rot=0, width=0.3, align='center', figsize=(15,12))
plt.xlabel("count")
plt.ylabel("Country")
Text(0, 0.5, 'Country')
result
country_name Hungary 1 Slovenia 1 Malta 1 Luxembourg 1 Sweden 2 Bulgaria 2 Cyprus 2 Slovakia 2 Romania 2 Lithuania 2 Czech Republic 3 Norway 4 Ireland 5 Finland 6 Austria 7 Iceland 8 Poland 8 Greece 8 Denmark 10 Switzerland 11 Portugal 13 United Kingdom 14 Netherlands 17 Belgium 18 Germany 35 Spain 41 Italy 81 France 99 dtype: int64
print("Countries:\t" + str(result.shape[0]) + " \nTotal fablabs:\t" + str(result.sum()))
Countries: 28 Total fablabs: 404