🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

datasus-dbc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datasus-dbc

Decompress DATASUS's dbc files into dbf files

0.1.3
Source
PyPI
Maintainers
1

datasus-dbc-py

PyPI version

This python library enables the decompression of *.dbc files commonly found on Brazil's DATASUS FTP server into *.dbf files.

This is a python bindings of the sibling library datasus-dbc, written in rust. Because of that, this library should be compatible with most platforms.

Instalation

pip install datasus-dbc

Usage

  • To decompress a *.dbc file into a *.dbf, use the decompress function:
import datasus_dbc

datasus_dbc.decompress("input.dbc", "output.dbf")
  • If you have the raw bytes of a *.dbc file, you can use decompress_bytes function to obtain the decompressed *.dbf raw bytes in memory:
import datasus_dbc

with open("input.dbc", "rb") as file:
    dbf_bytes = datasus_dbc.decompress_bytes(file.read())
    print(dbf_bytes)

Reading *.dbf files

This library does not support reading the contents of a *.dbf file. However, you can still use one of the following libraries: simpledbf or dbfread.

Found a bug?

If you encounter a bug or have a feature request, please feel free to create an issue on our GitHub repository. We welcome your feedback!

Keywords

dbc

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