Skip to main content

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!

Metadata

Release files for datasus-db 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datasus-db 0.1.3
File Size Uploaded Provenance Actions
datasus_db-0.1.3.tar.gz 14.1 kB Without provenance Details for datasus_db-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datasus-db 0.1.3
File Interpreter ABI Platform Actions
datasus_db-0.1.3-py3-none-any.whl Python 3 none any Details for datasus_db-0.1.3-py3-none-any.whl

Total release size: 36.2 kB

Release files / datasus_db-0.1.3.tar.gz

Download URL datasus_db-0.1.3.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b63c10b1ad34797806909086ad98cd65fbcb0442c3ec373b83f05c2a7e7f656a
BLAKE2b-256 checksum
How to use checksums
4387ea20110b53b7ae6599d98431b94b85df32848f30995cb872b1d312fa88a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-28-generic

Release files / datasus_db-0.1.3-py3-none-any.whl

Download URL datasus_db-0.1.3-py3-none-any.whl
Size 22.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14ff906fc23a484f62f54a78b6ea41d60eb14b84ef76482a825d593da274c718
BLAKE2b-256 checksum
How to use checksums
82feb395db3b68e527157002324b21ed3c7e4627d125b972d83a1c674f573f1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-28-generic

Security for datasus-db 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page