Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for DBC (compressed DBF) files #37

Open
augusto-herrmann opened this issue Oct 23, 2019 · 5 comments
Open

Support for DBC (compressed DBF) files #37

augusto-herrmann opened this issue Oct 23, 2019 · 5 comments

Comments

@augusto-herrmann
Copy link

Would it make sense for dbfread to support compressed DBF files – DBC files?

It would be similar to what the read.dbc package does in R. I couldn't find a package that does the same in Python. I've tried dbfread and it currently only reads uncompressed DBF files.

If you need DBC files for testing, there are lots of them at the DATASUS website (official public healthcare system statistics from Brazil).

@zaneselvans
Copy link

Oh that's what the DBC files are. I've got one which I've been grepping for strings to regenerate the names of all the tables and fields in a database from the US Federal Energy Regulatory Commission. It's a big pain! If it were possible to just read them directly, that would be much much better.

@zaneselvans
Copy link

Oh, haha, no it's not what I've got, unfortunately...

This function allows you decompress a DBC file into its DBF counterpart. Please note that this is the file format used by the Brazilian Ministry of Health (DATASUS), and it is not related to the FoxPro or CANdb DBC file formats.

@augusto-herrmann
Copy link
Author

I have found this other Python imlementation that is capable of reading DBC files from SUS, the Brazilian public health system.

So feel free to decide whether to implement the reading of these DBC files in dbfread, looking at their implementation, or not to.

@olemb
Copy link
Owner

olemb commented Dec 21, 2020

This would be nice to have.

We will first have to add support for reading from a file object (see issue #53) but once that is in place this is something we could definitely look into.

@Ochuat
Copy link

Ochuat commented Dec 18, 2023

It would be very valuable and useful to be able to decompress dbc files directly through this library, using Python.

I have already tested several repositories, libraries and codes to deal with the file extensions used by DataSuS, in Brazil; but I was unsuccessful, all leading me to an error in some component that became old or no longer existed.

It is possible to go the simpler route of just unpacking dbc to dbf; or to csv or pandas dataframe (I believe internally it is more viable without converting to dbf first).

But even without that, your creation is very valuable and helps me in my work. Congratulations and thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants