First gather the prefix for each link by going to https://datasus.saude.gov.br/transferencia-de-arquivos/
and choosing your source. For example, to download "Equipes de saúde em MG de 2007 a 2021" we get an arbitrary link to extract the prefix, I got ftp://ftp.datasus.gov.br/dissemin/publicos/CNES/200508_/Dados/EP/EPMG2101.dbc
which I then remove the date and suffix and end up with ftp://ftp.datasus.gov.br/dissemin/publicos/CNES/200508_/Dados/EP/EPMG
. Then I
- Put the prefix obtainded in
get_links.py
's variable namedlink_base
and run it. It should output alinks.json
file. - Run
python download_data.py
in this folder to download every.dbc
file into the folderbases_raw
. - Now that you've downloaded the data, run
python uncompress_data.py
to decompress every file from.dbc
to.csv
into the directorybases_descomprimidas
.
And you're done!