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.10.macosx-10.13-x86_64.tar.gz (62.7 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.10-py3-none-any.whl (55.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: edc-pdutils-0.1.10.macosx-10.13-x86_64.tar.gz
  • Upload date:
  • Size: 62.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for edc-pdutils-0.1.10.macosx-10.13-x86_64.tar.gz
Algorithm Hash digest
SHA256 fc615c28dfe4ec3e5f1217a996f3c6da4a6bb0d59ce1e11a7f30bb58942ac675
MD5 92cb85d82e514d2fb94438171564a137
BLAKE2b-256 ab8a0010366901881ef4c0a2f93b8b01fe5f4d29635cdffdcdf89cd7bf659e05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edc_pdutils-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 55.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for edc_pdutils-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 f99ebb655c24d910ff509fb9bd271fec4e15e549d886c54d0749e700ee8eadbb
MD5 047c094464a2c3210d85d097040c6ee5
BLAKE2b-256 bdc8a7c83c2bc27b9ba8e3e3fd5bdb557bc17d74bf452f644d5fc49733da56ea

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