Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
leynier committed Dec 14, 2020
2 parents dd6cc5c + 7ef825b commit 3bc443c
Show file tree
Hide file tree
Showing 11 changed files with 12,320 additions and 1 deletion.
92 changes: 92 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,77 @@ def save_data(name: str, data):
equitativamente, manteniendo una homogeneidad en ese sentido.
"""

"""
## ¿Qué juegos de mesa han recaudado más?
Los diez juegos de mesa que han recaudado más dinero a lo largo del tiempo han sido
los siguientes:
"""

# top_ten_all_the_time_projects = tabletop_games_model.top_ten_all_the_time_games()
# data = pd.DataFrame(
# [
# {
# "Nombre": project.name,
# "Recaudación": project.pledged,
# }
# for project in top_ten_all_the_time_projects
# ]
# )
# save_data("top_ten_all_the_time_projects", data.to_dict())
data = pd.DataFrame.from_dict(load_data("top_ten_all_the_time_projects"))

data

"""
Interesante como los dos que más han recaudado se separan bastante del
resto representando el `31.16%` del dinero total recaudado del top 10.
"""

"""
Los diez juegos de mesa que han recaudado más en el transcurso del 2020:
"""

# top_ten_2020_games = tabletop_games_model.top_ten_2020_games()
# data = pd.DataFrame(
# [
# {
# "Nombre": project.name,
# "Recaudación": project.pledged,
# }
# for project in top_ten_2020_games
# ]
# )
# save_data("top_ten_2020_games", data.to_dict())
data = pd.DataFrame.from_dict(load_data("top_ten_2020_games"))

data

"""
El 2020 está siendo un año con juegos con muy buena recaudación, teniendo 7 juegos
en común con el top 10 de todos los tiempos, destacándose **Frosthaven** como el
juego de mesa con más recaudación de todos los tiempos.
"""

# inter_set = set(top_ten_all_the_time_projects).intersection(set(top_ten_2020_games))

# inter_list = list(inter_set)
# inter_list.sort(key=lambda x: x.pledged, reverse=True)

# data = pd.DataFrame(
# [
# {
# "Nombre": project.name,
# "Recaudación": project.pledged,
# }
# for project in inter_list
# ]
# )
# save_data("inter_list", data.to_dict())
data = pd.DataFrame.from_dict(load_data("inter_list"))

data

"""
## ¿Por qué el auge de los Juegos de Mesa en Kickstarter?
Expand Down Expand Up @@ -563,6 +634,27 @@ def save_data(name: str, data):
mesa. [[5]](https://www.polygon.com/2019/6/5/18652411/trump-china-tariff-board-games)
"""

"""
## Metodología
Los análisis anteriores fueron realizados a partir de los datos obtenidos
y publicados por la página
[webrobots.io/kickstarter-datasets](https://webrobots.io/kickstarter-datasets/).
Los datos de los proyectos se encuentran en varios paquetes, obtenidos
de scrappear el sitio de Kickstarter los días 15 de cada mes desde el
año 2015 hasta noviembre del 2020. Debido a que los proyectos varían en
el tiempo muchos se encuentran enmarcados en diferentes paquetes de los
mencionados. Para evitar repeticiones fue necesario realizar un
preprocesamiento de los datos de los proyectos, a la vez que se realizaba
un filtrado de algunas de sus propiedades. Con los datos resultantes es
que se realizaron los diferentes estudios mostrados en este artículo.
Los códigos que realizan ambos procesamientos de los datos son
accesibles desde nuestro
[repositorio](https://github.com/codestrange/kickstarter/tree/main/kickstarter)
en Github.
"""

"""
## Referencias
Expand Down
1 change: 1 addition & 0 deletions jsons/inter_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Nombre": {"0": "Frosthaven", "1": "Mini Express \ud83d\ude82 A century of railroad expansion in 60 mins\u23f1\ufe0f", "2": "The Wyrmwood Modular Gaming Table: Coffee & Dining Models", "3": "Alternate Souls Arena Card Game", "4": "Squidmar: Kolinsky Miniature Paintbrush", "5": "Twilight: 2000 \u2013 Roleplaying in the WWIII That Never Was", "6": "Nemesis Lockdown"}, "Recaudaci\u00f3n": {"0": 12969608, "1": 8630732, "2": 8084529, "3": 6666387, "4": 6193174, "5": 5424755, "6": 5174153}}
1 change: 1 addition & 0 deletions jsons/top_ten_2020_games.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Nombre": {"0": "Frosthaven", "1": "Mini Express \ud83d\ude82 A century of railroad expansion in 60 mins\u23f1\ufe0f", "2": "The Wyrmwood Modular Gaming Table: Coffee & Dining Models", "3": "Alternate Souls Arena Card Game", "4": "Squidmar: Kolinsky Miniature Paintbrush", "5": "Twilight: 2000 \u2013 Roleplaying in the WWIII That Never Was", "6": "Nemesis Lockdown", "7": "Return to Dark Tower", "8": "Wildlands by Dwarven Forge: Handcrafted Modular Game Terrain", "9": "Massive Darkness 2: Hellscape"}, "Recaudaci\u00f3n": {"0": 12969608, "1": 8630732, "2": 8084529, "3": 6666387, "4": 6193174, "5": 5424755, "6": 5174153, "7": 4054744, "8": 4005183, "9": 3813274}}
1 change: 1 addition & 0 deletions jsons/top_ten_all_the_time_projects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Nombre": {"0": "Frosthaven", "1": "Kingdom Death: Monster 1.5", "2": "Exploding Kittens", "3": "Mini Express \ud83d\ude82 A century of railroad expansion in 60 mins\u23f1\ufe0f", "4": "The Wyrmwood Modular Gaming Table: Coffee & Dining Models", "5": "THE 7th CONTINENT \u2013 What Goes Up, Must Come Down.", "6": "Alternate Souls Arena Card Game", "7": "Squidmar: Kolinsky Miniature Paintbrush", "8": "Twilight: 2000 \u2013 Roleplaying in the WWIII That Never Was", "9": "Nemesis Lockdown"}, "Recaudaci\u00f3n": {"0": 12969608, "1": 12393139, "2": 8782571, "3": 8630732, "4": 8084529, "5": 7072757, "6": 6666387, "7": 6193174, "8": 5424755, "9": 5174153}}
14 changes: 14 additions & 0 deletions kickstarter/processing/tabletop_games.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@ def _segmented_project_by_pledged(self, project: ProjectModel) -> int:
return 3
return 4

def top_ten_all_the_time_games(self) -> List[ProjectModel]:
projects = [project for project in self.projects]
projects.sort(key=lambda x: x.pledged, reverse=True)
return projects[:10]

def top_ten_2020_games(self) -> List[ProjectModel]:
projects = [
project
for project in self.projects
if project.state_changed_at.year == 2020
]
projects.sort(key=lambda x: x.pledged, reverse=True)
return projects[:10]

def to_json(self):
return {
"projects": [value.to_json() for value in self.projects],
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pathtools==0.1.2; python_version >= "3.6"
pexpect==4.8.0; sys_platform != "win32" and python_version >= "3.7"
pickleshare==0.7.5; python_version >= "3.7"
pillow==8.0.1; python_version >= "3.6"
plotly==4.13.0
plotly==4.14.1
prometheus-client==0.9.0; python_version >= "3.6"
prompt-toolkit==3.0.8; python_full_version >= "3.6.1" and python_version >= "3.7"
protobuf==3.14.0; python_version >= "3.6"
Expand Down
7 changes: 7 additions & 0 deletions website/assets/css/bootstrap.min.css

Large diffs are not rendered by default.

Binary file added website/assets/images/header.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions website/assets/js/bootstrap.bundle.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 3bc443c

Please sign in to comment.