Use pandas with clinicedc/edc projects
Project description
edc-pdutils
Use pandas with the Edc
To export Crf data, for example:
csv_path = '/Users/erikvw/Documents/ambition/export/'
date_format = '%Y-%m-%d'
sep = ','
class MyDfHandler(CrfDfHandler):
visit_tbl = 'ambition_subject_subjectvisit'
exclude_columns = ['form_as_json', 'survival_status','last_alive_date',
'screening_age_in_years', 'registration_datetime',
'subject_type']
class MyCsvCrfTablesExporter(CsvCrfTablesExporter):
visit_columns = ['subject_visit_id']
datetime_fields = ['randomization_datetime']
df_handler_cls = MyDfHandler
app_label = 'ambition_subject'
export_folder = csv_path
sys.stdout.write('\n')
exporter = MyCsvCrfTablesExporter()
exporter.to_csv(date_format=date_format, delimiter=sep)
To export INLINE data for any CRF configured with an inline, for example:
class MyDfHandler(CrfDfHandler):
visit_tbl = 'ambition_subject_subjectvisit'
exclude_columns = ['form_as_json', 'survival_status','last_alive_date',
'screening_age_in_years', 'registration_datetime',
'subject_type']
class MyCsvCrfInlineTablesExporter(CsvCrfInlineTablesExporter):
visit_columns = ['subject_visit_id']
df_handler_cls = MyDfHandler
app_label = 'ambition_subject'
export_folder = csv_path
exclude_inline_tables = [
'ambition_subject_radiology_abnormal_results_reason',
'ambition_subject_radiology_cxr_type']
sys.stdout.write('\n')
exporter = MyCsvCrfInlineTablesExporter()
exporter.to_csv(date_format=date_format, delimiter=sep)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for edc-pdutils-0.1.9.macosx-10.13-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d6820513336472ba72ab85edf47a6d0f992c0a4101d50428230e62bb58747e7 |
|
MD5 | fdd1e6465aa1a18873b81e41b52b43dc |
|
BLAKE2b-256 | dbb37fa712a5bcfe21e067c1a35df2f69eaddd043e3cb2238549cb35abd212ad |
Close
Hashes for edc_pdutils-0.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6628e3d6a46f1d5fc7e717a3cc3ff1caf69b04ee75f881784ab7f6aa501c7ef0 |
|
MD5 | f9af36542ce41b83e9449400fcfa20a6 |
|
BLAKE2b-256 | 463f79493b792c329efc4a50d89684aea3407c7a1f1bb5448ca7c9610c5c755e |