Skip to main content

bcpp.

Project description

pypi travis coverage

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'
    registered_subject_tbl = 'edc_registration_registeredsubject'
    appointment_tbl = 'edc_appointment_appointment'
    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'
    registered_subject_tbl = 'edc_registration_registeredsubject'
    appointment_tbl = 'edc_appointment_appointment'
    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

edc-pdutils-0.1.2.macosx-10.13-x86_64.tar.gz (62.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edc_pdutils-0.1.2-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file edc-pdutils-0.1.2.macosx-10.13-x86_64.tar.gz.

File metadata

File hashes

Hashes for edc-pdutils-0.1.2.macosx-10.13-x86_64.tar.gz
Algorithm Hash digest
SHA256 db32b7feea36ea35a97c27cb4fe2e866a92d53cdfec529dcc390990d66769a67
MD5 9d42670f22aede259458de8b984ccf8e
BLAKE2b-256 b95fa25c8d3dcbbe45d311f9411c5d633c29ba4d5e853a23180f40731d3dafad

See more details on using hashes here.

File details

Details for the file edc_pdutils-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for edc_pdutils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4d8b0d40497f5afdf4398d1c3c0c9775a9bb3e68e97a6c252306fb85da1ac95a
MD5 75900f6228e5be0b63ef604800409d0f
BLAKE2b-256 3135563952a8cd459a8213ed6c1d2f16aad46e505d3be5b8d8321b1f17141221

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page