module datasource.convert

Short summary

module pyensae.datasource.convert

Various conversion functions.

source on GitHub

Functions

function

truncated documentation

dBase2df

converts a dBase file into a list of dataframe (one per table)

dBase2sqllite

Put all rows from a dBase database into sqlite Add a dbase table to an open sqlite database.

Documentation

Various conversion functions.

source on GitHub

pyensae.datasource.convert.dBase2df(file, encoding='cp437')[source]

converts a dBase file into a list of dataframe (one per table)

Parameters
  • file – file name

  • encoding – table encoding

Returns

list of dataframes (pandas)

The module relies on dbfread.

source on GitHub

pyensae.datasource.convert.dBase2sqllite(db, table, encoding='cp437', overwrite_table=None, fLOG=<function noLOG>)[source]

Put all rows from a dBase database into sqlite

Add a dbase table to an open sqlite database.

Parameters
  • db – cursor on SQLite or file name

  • table – DBF object or filename

  • encoding – encoding if table is a filename

  • overwrite_table – overwrite the table name

  • fLOG – logging function, to see the progress

The table will be removed if it exists.

source on GitHub