Skip to main content

Download and import DATASUS's public data to a DuckDB database

Project description

datasus-db

PyPI version Documentation

A python package to download and import public available data from DATASUS's ftp servers into a DuckDB database.

Why DuckDB?

DuckDB is a local database similar to sqlite, but it is tailor made with analytical processing in mind, which makes it a great tool for analysing DATASUS's data. To see all the features DuckDB provides, check out their documentation.

Installation

pip install datasus-db

Usage

import datasus_db
import logging


def main():
    # If you want to enable logging
    logging.getLogger().setLevel(logging.INFO)

    # Import SIM DO (Sistema de Informações de Mortalidade - Declarações de Óbito) data
    # By default the data is imported to the file `datasus.db`
    datasus_db.import_sim_do()

    # Import PO (Painel de Oncologia) data
    datasus_db.import_po(db_file="other-name.db")

    # Import SIH RD (Sistema de Informações Hospitalares do SUS - AIH Reduzida) data
    datasus_db.import_sih_rd()

    # Import SP (Autorização de Internação Hospitalar Saúde do Profissional) from SIHSUS (Sistema de Informações Hospitalares do SUS).
    datasus_db.import_sih_sp()

    # Import PA (Produção Ambulatorial) from SIASUS (Sistema de Informações Ambulatorial do SUS).
    datasus_db.import_sia_pa()

    # Import IBGE POP (População IBGE - Agregada por município, sexo e faixa etaria) data
    datasus_db.import_ibge_pop()

    # Import IBGE POP TCU (População IBGE - Tribunal de Contas da União) data
    datasus_db.import_ibge_pop_tcu()

    # Import auxiliar tables (Municipios, UFs e doenças)
    datasus_db.import_auxiliar_tables()


if __name__ == "__main__":
    main()

Documentation

Check out the project's documentation:

View documentation

Found a bug or want a new feature?

Feel free to create an issue here if you found a bug or if you want a new feature!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasus_db-0.1.3.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

datasus_db-0.1.3-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file datasus_db-0.1.3.tar.gz.

File metadata

  • Download URL: datasus_db-0.1.3.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-28-generic

File hashes

Hashes for datasus_db-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b63c10b1ad34797806909086ad98cd65fbcb0442c3ec373b83f05c2a7e7f656a
MD5 0eb693cb7de5a1f6e51b0e762a18225d
BLAKE2b-256 4387ea20110b53b7ae6599d98431b94b85df32848f30995cb872b1d312fa88a5

See more details on using hashes here.

File details

Details for the file datasus_db-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: datasus_db-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-28-generic

File hashes

Hashes for datasus_db-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 14ff906fc23a484f62f54a78b6ea41d60eb14b84ef76482a825d593da274c718
MD5 a6c144c5167510dcb15e59bafa01ecef
BLAKE2b-256 82feb395db3b68e527157002324b21ed3c7e4627d125b972d83a1c674f573f1f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page