You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

datasus-fetcher

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datasus-fetcher

Downloader of DATASUS raw data files

0.4.1
pipPyPI
Maintainers
1

datasus-fetcher

This package function is to download DATASUS raw data files (DBC) from its FTP server. It does not have reading functions.

Installation

pip install datasus-fetcher

Or install via pipx:

pipx install datasus-fetcher

Usage

Use the command line interface to download files:

datasus-fetcher data --data-dir /path/to/data-dir sih-rd --start 2020-01 --end 2023-12 --regions sp rj mg

This will download all files from the SIH-RD dataset from January 2020 to December 2023 for the states of São Paulo, Rio de Janeiro and Minas Gerais.

You can also omit the dataset name, the start and end dates and the regions to download all available datasets:

datasus-fetcher data --data-dir /path/to/data-dir

List datasets

DatasetNº filesTotal sizePeriod range
base-populacional-ibge-pop33 files150.4 MBfrom 1980 to 2012
base-populacional-ibge-pops25 files81.3 MBfrom 2000 to 2024
base-populacional-ibge-popt32 files2.4 MBfrom 1992 to 2024
base-territorial14 files20.9 MBfrom ---- to ----
base-territorial-conversao28 files35.7 MBfrom ---- to ----
base-territorial-mapas83 files122.2 MBfrom 1991 to 2013
cih-cr868 files157.5 MBfrom 2008-01 to 2011-04
ciha4201 files4354.5 MBfrom 2011-01 to 2024-09
cnes-dc6318 files115.4 MBfrom 2005-08 to 2025-01
cnes-ee3201 files4.3 MBfrom 2007-03 to 2021-07
cnes-ef5374 files10.0 MBfrom 2007-03 to 2025-01
cnes-ep5778 files498.8 MBfrom 2007-04 to 2025-01
cnes-eq6317 files1329.2 MBfrom 2005-08 to 2025-01
cnes-gm5459 files11.9 MBfrom 2007-03 to 2025-01
cnes-hb5805 files122.2 MBfrom 2007-03 to 2025-01
cnes-in5520 files36.4 MBfrom 2007-10 to 2025-01
cnes-lt6264 files131.3 MBfrom 2005-10 to 2025-01
cnes-pf6318 files38238.1 MBfrom 2005-08 to 2025-01
cnes-rc5744 files67.2 MBfrom 2007-03 to 2025-01
cnes-sr6316 files1389.8 MBfrom 2005-08 to 2025-01
cnes-st6310 files2805.5 MBfrom 2005-08 to 2025-01
pce409 files14.1 MBfrom 1995 to 2021
po12 files129.5 MBfrom 2013 to 2024
resp280 files3.4 MBfrom 2015 to 2024
sia-ab544 files13.9 MBfrom 2008-01 to 2017-04
sia-abo1352 files32.2 MBfrom 2014-01 to 2024-12
sia-acf3263 files26.7 MBfrom 2014-08 to 2024-12
sia-ad5506 files2683.1 MBfrom 2008-01 to 2024-12
sia-am5447 files14762.8 MBfrom 2008-01 to 2024-12
sia-an2145 files437.6 MBfrom 2008-01 to 2014-10
sia-aq5466 files4202.1 MBfrom 2008-01 to 2024-12
sia-ar4982 files318.9 MBfrom 2008-01 to 2024-12
sia-atd3371 files855.0 MBfrom 2014-08 to 2024-12
sia-pa10193 files163258.4 MBfrom 1994-07 to 2024-12
sia-ps3881 files2543.1 MBfrom 2012-11 to 2024-12
sia-sad1088 files51.0 MBfrom 2012-04 to 2018-10
sih-er4419 files270.4 MBfrom 2011-01 to 2024-12
sih-rd10673 files22639.1 MBfrom 1992-01 to 2024-12
sih-rj5348 files815.8 MBfrom 2008-01 to 2024-12
sih-sp8928 files48377.4 MBfrom 1997-06 to 2024-12
sim-do-cid09466 files722.2 MBfrom 1979 to 1995
sim-do-cid10784 files4307.5 MBfrom 1996 to 2023
sim-doext-cid0917 files42.0 MBfrom 1979 to 1995
sim-doext-cid1028 files260.2 MBfrom 1996 to 2023
sim-dofet-cid0917 files23.0 MBfrom 1979 to 1995
sim-dofet-cid1028 files60.9 MBfrom 1996 to 2023
sim-doinf-cid0917 files58.0 MBfrom 1979 to 1995
sim-doinf-cid1028 files92.0 MBfrom 1996 to 2023
sim-domat-cid1028 files4.1 MBfrom 1996 to 2023
sim-dorext-cid1011 files0.4 MBfrom 2013 to 2023
sinan-acbi19 files44.2 MBfrom 2006 to 2024
sinan-acgr19 files112.4 MBfrom 2006 to 2024
sinan-aida17 files17.1 MBfrom 2007 to 2023
sinan-aidc17 files0.3 MBfrom 2007 to 2023
sinan-anim17 files127.5 MBfrom 2007 to 2023
sinan-antr19 files432.7 MBfrom 2006 to 2024
sinan-botu18 files0.1 MBfrom 2007 to 2024
sinan-canc18 files0.3 MBfrom 2007 to 2024
sinan-chag24 files4.0 MBfrom 2000 to 2023
sinan-chik11 files70.7 MBfrom 2015 to 2025
sinan-cole18 files0.0 MBfrom 2007 to 2024
sinan-coqu19 files9.1 MBfrom 2007 to 2025
sinan-deng26 files1229.0 MBfrom 2000 to 2025
sinan-derm19 files0.5 MBfrom 2006 to 2024
sinan-dift16 files0.1 MBfrom 2007 to 2022
sinan-espo10 files0.4 MBfrom 2013 to 2022
sinan-esqu17 files7.6 MBfrom 2007 to 2023
sinan-exan18 files14.0 MBfrom 2007 to 2024
sinan-fmac17 files3.9 MBfrom 2007 to 2023
sinan-ftif18 files0.8 MBfrom 2007 to 2024
sinan-hans24 files53.6 MBfrom 2001 to 2024
sinan-hant25 files2.1 MBfrom 1999 to 2023
sinan-hepa17 files28.1 MBfrom 2007 to 2023
sinan-hiva17 files15.3 MBfrom 2007 to 2023
sinan-hivc17 files0.1 MBfrom 2007 to 2023
sinan-hive9 files1.0 MBfrom 2015 to 2023
sinan-hivg17 files3.4 MBfrom 2007 to 2023
sinan-iexo19 files150.3 MBfrom 2006 to 2024
sinan-leiv25 files12.1 MBfrom 2000 to 2024
sinan-lept18 files21.5 MBfrom 2007 to 2024
sinan-lerd19 files6.5 MBfrom 2006 to 2024
sinan-ltan25 files36.2 MBfrom 2000 to 2024
sinan-mala20 files2.5 MBfrom 2004 to 2023
sinan-meni18 files40.9 MBfrom 2007 to 2024
sinan-ment19 files1.2 MBfrom 2006 to 2024
sinan-ntra13 files0.6 MBfrom 2010 to 2022
sinan-pair19 files0.5 MBfrom 2006 to 2024
sinan-pest14 files0.0 MBfrom 2007 to 2020
sinan-pfan10 files0.5 MBfrom 2012 to 2021
sinan-pneu19 files0.3 MBfrom 2006 to 2024
sinan-raiv15 files0.1 MBfrom 2007 to 2021
sinan-rota16 files1.2 MBfrom 2009 to 2024
sinan-sdta14 files0.8 MBfrom 2007 to 2021
sinan-sifa15 files28.3 MBfrom 2010 to 2024
sinan-sifc18 files13.3 MBfrom 2007 to 2024
sinan-sifg17 files16.7 MBfrom 2007 to 2023
sinan-src16 files0.2 MBfrom 2007 to 2022
sinan-teta16 files0.6 MBfrom 2007 to 2022
sinan-tetn8 files0.0 MBfrom 2014 to 2021
sinan-toxc6 files0.8 MBfrom 2019 to 2024
sinan-toxg6 files2.3 MBfrom 2019 to 2024
sinan-trac14 files1.6 MBfrom 2009 to 2022
sinan-tube23 files97.8 MBfrom 2001 to 2023
sinan-varc17 files33.2 MBfrom 2007 to 2023
sinan-viol15 files242.4 MBfrom 2009 to 2023
sinan-zika10 files8.9 MBfrom 2016 to 2025
sinasc-dn838 files6114.7 MBfrom 1994 to 2023
sinasc-dnex10 files0.5 MBfrom 2014 to 2023
siscolo-cc2858 files2380.9 MBfrom 2006-01 to 2015-10
siscolo-hc2858 files38.9 MBfrom 2006-01 to 2015-10
sismama-cm1675 files4.8 MBfrom 2009-01 to 2015-07
sismama-hm1674 files5.7 MBfrom 2009-01 to 2015-07
sisprenatal-pn944 files221.6 MBfrom 2012-01 to 2014-12

Total size: 320.7 GB

Total files: 170543 files

Statistics generated on 2025-02-18

Data sources

Online queries: https://datasus.saude.gov.br/informacoes-de-saude-tabnet/

Microdata: https://datasus.saude.gov.br/transferencia-de-arquivos/

Available datasets

  • Base Populacional - IBGE
    • BASE-POPULACIONAL-IBGE-POP: Censo e Estimativas
    • BASE-POPULACIONAL-IBGE-POPS: Estimativas por Sexo e Idade
    • BASE-POPULACIONAL-IBGE-POPT: Estimativas TCU
  • Base Territorial - Mapas e conversões para tabulação
    • Base Territoriais
    • Mapas
    • Conversões
  • CIH: Sistema de Comunicação de Informação Hospitalar
    • CIH-CR: Comunicação de Internação Hospitalar
  • CIHA: Sistema de Comunicação de Informação Hospitalar e Ambulatorial
    • CIHA-CIHA: Sistema de Comunicação de Informação Hospitalar e Ambulatorial
  • CNES: Cadastro Nacional de Estabelecimentos de Saúde
    • CNES-LT: Leitos
    • CNES-ST: Estabelecimentos
    • CNES-DC: Dados Complementares
    • CNES-EQ: Equipamentos
    • CNES-SR: Serviço Especializado
    • CNES-HB: Habilitação
    • CNES-PF: Profissional
    • CNES-EP: Equipes
    • CNES-RC: Regra Contratual
    • CNES-IN: Incentivos
    • CNES-EE: Estabelecimento de Ensino
    • CNES-EF: Estabelecimento Filantrópico
    • CNES-GM: Gestão e Metas
  • PCE: Programa de Controle da Esquistossomose
    • PCE-PCE: Programa de Controle da Esquistossomose
  • PO: Painel de Oncologia
    • PO-PO: Painel de Oncologia
  • RESP: Notificações de casos suspeitos de SCZ
    • RESP: Notificações de casos suspeitos de SCZ
  • SIA: Sistema de Informações Ambulatoriais
    • SIA-AB: APAC de Acompanhamento a Cirurgia Bariátrica
    • SIA-ABO: APAC Acompanhamento Pós Cirurgia Bariátrica
    • SIA-ACF: APAC Confeção de Fístula Arteriovenosa
    • SIA-AD: APAC de Laudos Diversos
    • SIA-AM: APAC de Medicamentos
    • SIA-AN: APAC de Nefrologia
    • SIA-AQ: APAC de Quimioterapia
    • SIA-AR: APAC de Radioterapia
    • SIA-ATD: APAC de Tratamento Dialítico
    • SIA-PA: Produção Ambulatorial
    • SIA-PS: Psicossocial
    • SIA-SAD: Atenção Domiciliar
  • SIH: Sistema de Informação Hospitalar (Descentralizado)
    • SIH-RD: AIH Reduzida
    • SIH-RJ: AIH Rejeitadas
    • SIH-SP: Serviços Profissionais
    • SIH-ER: AIH Rejeitadas com código de erro
  • SIM: Sistema de Informação de Mortalidade
    • SIM-DO: Declarações de Óbito
    • SIM-DOEXT: Declarações de Óbitos por causas externas
    • SIM-DOFET: Declarações de Óbitos fetais
    • SIM-DOINF: Declarações de Óbitos infantis
    • SIM-DOMAT: Declarações de Óbitos maternos
    • SIM-DOREXT: Mortalidade de residentes no exterior
  • SINAN: Sistema de agravos de notificação compulsória
    • SINAN-ACBI: Acidente de trabalho com material biológico
    • SINAN-ACGR: Acidente de trabalho
    • SINAN-AIDA: AIDS em adultos
    • SINAN-AIDC: AIDS em crianças
    • SINAN-ANIM: Acidente por Animais Peçonhentos
    • SINAN-ANTR: Atendimento Antirrabico
    • SINAN-BOTU: Botulismo
    • SINAN-CANC: Cancêr relacionado ao trabalho
    • SINAN-CHAG: Doença de Chagas Aguda
    • SINAN-CHIK: Febre de Chikungunya
    • SINAN-COLE: Cólera
    • SINAN-COQU: Coqueluche
    • SINAN-DENG: Dengue
    • SINAN-DERM: Dermatoses ocupacionais
    • SINAN-DIFT: Difteria
    • SINAN-ESPO: Esporotricose (Epizootia)
    • SINAN-ESQU: Esquistossomose
    • SINAN-EXAN: Doenças exantemáticas
    • SINAN-FMAC: Febre Maculosa
    • SINAN-FTIF: Febre Tifóide
    • SINAN-HANS: Hanseníase
    • SINAN-HANT: Hantavirose
    • SINAN-HEPA: Hepatites Virais
    • SINAN-HIVA: HIV em adultos
    • SINAN-HIVC: HIV em crianças
    • SINAN-HIVE: HIV em crianças expostas
    • SINAN-HIVG: HIV em gestante
    • SINAN-IEXO: Intoxicação Exógena
    • SINAN-LEIV: Leishmaniose Visceral
    • SINAN-LEPT: Leptospirose
    • SINAN-LERD: LER/Dort
    • SINAN-LTAN: Leishmaniose Tegumentar Americana
    • SINAN-MALA: Malária
    • SINAN-MENI: Meningite
    • SINAN-MENT: Transtornos mentais relacionados ao trabalho
    • SINAN-NTRA: Notificação de Tracoma
    • SINAN-PAIR: Perda auditiva por ruído relacionado ao trabalho
    • SINAN-PEST: Peste
    • SINAN-PFAN: Paralisia Flácida Aguda
    • SINAN-PNEU: Pneumoconioses relacionadas ao trabalho
    • SINAN-RAIV: Raiva
    • SINAN-ROTA: Rotavírus
    • SINAN-SDTA: Surto Doenças Transmitidas por Alimentos
    • SINAN-SIFA: Sífilis Adquirida
    • SINAN-SIFC: Sífilis Congênita
    • SINAN-SIFG: Sífilis em Gestante
    • SINAN-SRC: Síndrome da Rubéola Congênia
    • SINAN-TETA: Tétano Acidental
    • SINAN-TETN: Tétano Neonatal
    • SINAN-TOXC: Toxoplasmose Congênita
    • SINAN-TOXG: Toxoplasmose Gestacional
    • SINAN-TRAC: Inquérito de Tracoma
    • SINAN-TUBE: Tuberculose
    • SINAN-VARC: Varicela
    • SINAN-VIOL: Violência doméstica, sexual e/ou outras violências
    • SINAN-ZIKA: Zika Vírus
  • SINASC: Sistema de Informação de Nascidos Vivos
    • SINASC-DN: Declarações de nascidos vivos 1994 a 2020
    • SINASC-DNEX: Declarações de nascidos vivos no exterior 2014 a 2020
  • SISCOLO: Sistema de Informações de Cânceres de Colo de Útero
    • SISCOLO-CC: Citopatológico de Colo de Útero
    • SISCOLO-HC: Histopatológico de Colo de Útero
  • SISMAMA: Sistema de Informações de Cânceres de Mama
    • SISMAMA-CM: Citopatológico de Mama
    • SISMAMA-HC: Histopatológico de Mama
  • SISPRENATAL: Sistema de Monitoramento e Avaliação do Pré-Natal, Parto, Puepério e Criança
    • SISPRENATAL-PN: Pré-Natal

Development

Install development version from Github running this command:

pip install -e git+https://github.com/dankkom/datasus-fetcher.git

Run unit tests with:

python -m unittest discover

Build and publish package

Build package with:

python -m build

Publish package to PyPI with:

python -m twine upload dist/*

See Python Packaging User Guide: The Packaging Workflow for more information.

Keywords

data

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.