Skip to main content

Use pandas with clinicedc/edc projects

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'
    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

edc-pdutils-0.1.8.macosx-10.13-x86_64.tar.gz (63.1 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.8-py3-none-any.whl (43.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: edc-pdutils-0.1.8.macosx-10.13-x86_64.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for edc-pdutils-0.1.8.macosx-10.13-x86_64.tar.gz
Algorithm Hash digest
SHA256 12f3d54416b33a5a6fb7bc5bc28f81b1fe5592a6e292c4501ad8c667120cf21a
MD5 7371a066fad36e7cea8c2ea1acd9053e
BLAKE2b-256 47dd609a84e140cf100c9d0c1428b70ba5c5cb6ceedc7eeceb6b059b9b45e0dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edc_pdutils-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 43.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for edc_pdutils-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1243a3517df38058b5ed08dfa2674702cd1849ea9e35263ec5ab430693affedb
MD5 d915b06e6253e379fc42868ee99a70fe
BLAKE2b-256 486c36a6ef8e1313a775ef2486cf27d789d0e1005546cf94f4200e750eb0de5b

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