Skip to content

Instantly share code, notes, and snippets.

View fernandascovino's full-sized avatar

Fernanda Scovino fernandascovino

View GitHub Profile
@fernandascovino
fernandascovino / gh_project_status.py
Last active January 9, 2023 17:53
Print issues and drafts by field columns (kanban)
# Get gh access token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
# How to use the GraphQL API on gh: https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects#finding-information-about-items-in-a-project
import requests
import json
# Set config
url = 'https://api.github.com/graphql'
# token = ...
@fernandascovino
fernandascovino / interactive-plots.py
Last active March 13, 2023 20:54
Make an interactive graph combining a scatter and a map in Python. The goal here is to combine both similar to: https://twitter.com/RosanaFerrero/status/1610257176978755586
import plotly.graph_objects as go
import plotly.express as px
import pandas as pd
from plotly.subplots import make_subplots
df = px.data.gapminder()
# Rewritten to show side by side
fig = make_subplots(
rows=1, cols=2, shared_yaxes=True, subplot_titles=('Scatter Plot', 'Map'),
@fernandascovino
fernandascovino / intersect_point_to_hexagon
Last active December 22, 2021 15:54 — forked from JoaoCarabetta/intersect_point_to_hexagon
Intersect point to hexagon - SQL Base dos Dados
select id_grid_h3, hora, ST_ASTEXT(ANY_VALUE(geometria)) wkt, count(*) n_registros, ANY_VALUE(quantidade_pessoas) populacao
from `rj-smtr.br_rj_riodejaneiro_onibus_gps.registros_tratada` t1
join `basedosdados.br_ipea_acesso_oportunidades.estatisticas_2019` t2
on st_intersects(geometria, st_geogpoint(longitude, latitude))
where id_municipio in (
select id_municipio
from `basedosdados.br_bd_diretorios_brasil.municipio`
where nome = 'Rio de Janeiro')
group by id_grid_h3, hora
@fernandascovino
fernandascovino / wheel_cmd.sh
Created December 31, 2020 00:33
change wheel package (example with streamlit-0.70.0)
# runs to unpack wheel to 3 subfolders: streamlit-0.70.0, streamlit-0.70.0.data, streamlit-0.70.0.dist_info
# (you can just delete or move this whl to other place now)
unzip streamlit-0.70.0-py2.py3-none-any.whl
# GO CRAZY: change whatever you need in the unpacked folder! ...
# make dir with folder name you want to pack again
mkdir streamlit-0.70.0-py2.py3-none-any
# move the 3 subfolders to the folder created