Coder Social home page Coder Social logo

mymatsubara / datasus-db Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 3.0 2.81 MB

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

Home Page: https://pypi.org/project/datasus-db/

License: MIT License

Python 100.00%
data-science datasus duckdb health-data

datasus-db's Introduction

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!

datasus-db's People

Contributors

mymatsubara avatar leosbrito avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.