Use pandas with clinicedc/edc projects


Keywords
django, Edc, pandas, clinicedc, clinical, trials, clinical-research, clinical-trials, health-informatics
Licenses
xpp/MIT-feh
Install
pip install edc-pdutils==0.3.37

Documentation

pypi actions codecov downloads

edc-pdutils

Use pandas with the Edc

Using the management command to export to CSV and STATA

The export_models management command requires you to log in with an account that has export permissions.

The basic command requires an app_label (-a) and a path to the export folder (-p)

By default, the export format is CSV but delimited using the pipe delimiter, |.

Export one or more modules

The -a excepts more than one app_label

Export data in CSV format or STATA format

To export as CSV where the delimiter is |

To export as STATA dta use option -f stata

Export encrypted data

To export encrypted fields include option --decrypt:

Note: If using the --decrypt option, the user account will need PII_EXPORT permissions

Export with a simple file name

To export using a simpler filename that drops the tablename app_label prefix and does not include a datestamp suffix.

Add option --use_simple_filename.

Export for a country only

Add option --country.

Export manually

To export Crf data, for example:

To export INLINE data for any CRF configured with an inline, for example:

Using model_to_dataframe

Settings

EXPORT_FILENAME_TIMESTAMP_FORMAT: True/False (Default: False)

By default a timestamp of the current date is added as a suffix to CSV export filenames.

By default a timestamp of format %Y%m%d%H%M%S is added.

EXPORT_FILENAME_TIMESTAMP_FORMAT may be set to an empty string or a valid format for strftime.

If EXPORT_FILENAME_TIMESTAMP_FORMAT is set to an empty string, "", a suffix is not added.

For example: