Skip to content

Instantly share code, notes, and snippets.

View brauliobarahona's full-sized avatar

Braulio Barahona brauliobarahona

View GitHub Profile
@brauliobarahona
brauliobarahona / get_git_remotes.py
Last active May 12, 2025 08:24
get git remotes of a list of folders
import glob, subprocess
#set path to main directory
#!pwd :: _dir = !pwd
_dir = glob.os.getcwd()
# list all files in the data directory
alld = glob.os.listdir(_dir)
# get remote from those directories that are git repositories
@brauliobarahona
brauliobarahona / pv_installations_snippet.csv
Created December 19, 2022 22:31
Join data from Swiss solar PV installations to solar PV potential
xtf_id Address PostCode Municipality Canton BeginningOfOperation InitialPower TotalPower MainCategory SubCategory PlantCategory _x _y
14727 Schlosstrasse 15 4147 Aesch BL BL 05.05.09 14.65 18.81 maincat_2 subcat_2 plantcat_9 2611935.574 1257010.652
14728 Ob der Steig 1 5082 Kaisten AG 28.10.11 5.80 5.80 maincat_2 subcat_2 plantcat_8 2645758.387 1265094.285
10164 Gässli 4 3114 Wichtrach BE 07.10.08 3.00 3.00 maincat_2 subcat_2 plantcat_8 2610546.709 1188978.725
10794 Diemtigtalstrasse 46 3753 Oey BE 27.06.08 8.40 8.40 maincat_2 subcat_2 plantcat_8 2610528.945 1167345.635
9476 Holzweidstrasse 8 8340 Hinwil ZH 21.04.06 4.80 4.80 maincat_2 subcat_2 plantcat_8 2705863.006 1240552.876
? xxxx_strasse X 7556;7559 Valsot GR dd.mm.yy X.X0 X.X0 maincat_? subcat_? plantcat_? 2831972.730 1201616.228
@brauliobarahona
brauliobarahona / _get_swissgrid_data.py
Created April 21, 2020 19:15 — forked from philshem/_get_swissgrid_data.py
get swiss energy consumption open data, combine with weather measurements https://twitter.com/philshem/status/1252535904918478850
import os
import pandas as pd
from datetime import datetime
url='https://www.swissgrid.ch/dam/dataimport/energy-statistic/EnergieUebersichtCH-{YEAR}.xls'
dfs = []
for y in range(2009,datetime.now().year+1):
# generate url with year in it
url_y = url.format(YEAR=str(y))