PySUS icon indicating copy to clipboard operation
PySUS copied to clipboard

[FEATURE]: Population per state/year on IBGE

Open fccoelho opened this issue 1 year ago • 5 comments

The dataSUS FTP has this info in the directory /dissemin/publicos/IBGE/pop

This should me made accessible via the IBGE module

fccoelho avatar Mar 30 '24 11:03 fccoelho

Gotta be careful with how these projections are done, however.

maxbiostat avatar Mar 30 '24 12:03 maxbiostat

I've implemented the populacao_estimada.py script which finds, downloads and converts/normalizes data from IBGE. It currently downloads and normalizes estimates only but I'm willing to also add support for census data. Maybe we can reuse some of that code here. The result CSVs are hosted on repository, so you can check if it has the information you need (it can download more than one estimate for year, if available).

turicas avatar Apr 01 '24 15:04 turicas

Interesting because it pulls from IBGE FTP server directly. What we are doing so far is to use the data collected made available by DATASUS.

I think it is worth to integrate your script as well, and make available both sets of estimates, because sometimes people have reasons to stick with one or the other source. Also, the estimating methodologies for non-census years may be different. @luabida can you take a Look at @turicas code?

fccoelho avatar Apr 01 '24 16:04 fccoelho

It would be nice to adapt the code to use the same strategy to scan the FTP server direcly as we do in PySUS for the DATASUS FTP server, instead of relying on a list of hardcoded urls for the xls files.

fccoelho avatar Apr 01 '24 16:04 fccoelho

It would be nice to adapt the code to use the same strategy to scan the FTP server direcly as we do in PySUS for the DATASUS FTP server, instead of relying on a list of hardcoded urls for the xls files.

The list of XLS files is hard-coded just because I didn't want to scrape everytime I run the script (since it does not change very often), but I implemented the code to extract the URLs automatically (so you don't need to rely on that hard-coded dict).

turicas avatar Apr 01 '24 17:04 turicas

Finished on #193, the code can be seen here

luabida avatar May 14 '24 06:05 luabida