Coder Social home page Coder Social logo

mymatsubara / datasus-dbc-py Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 11 KB

Decompress DATASUS's dbc files into dbf files in python.

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

Python 16.48% Rust 83.52%
blast data-science datasus dbc dbf decompress python

datasus-dbc-py's Introduction

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!

datasus-dbc-py's People

Contributors

mymatsubara avatar

Stargazers

Iris Herdy 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.