Skip to main content

Export EDC model data to pandas dataframe for clinicedc/edc projects

Project description

pypi actions codecov downloads

edc-model-to-dataframe

ModelToDataframe exports EDC subject data into a pandas dataframe. On export it will add subject_identifier and visit tracking columns specific to the EDC. Also, by default, encrypted fields are not exported.

M2M columns are joined into a single field value delimited by comma.

Note: If you are just exporting raw tables, use django_pandas read_frame.

Pass a model name:

from django.apps import apps as django_apps
from edc_model_to_dataframe import ModelToDataframe

model = "meta_subject.followupexaminiation"
m = ModelToDataframe(model)
df = m.dataframe

Pass a queryset:

# using a queryset
model_cls = django_apps.get_model("meta_subject.followupexaminiation")
m = ModelToDataframe(model_cls.objects.all())
df = m.dataframe

read_frame_edc: like in django_pandas, there is a read_frame -like function which wraps ModelToDataframe

from edc_model_to_dataframe import read_frame_edc

model_cls = django_apps.get_model(model)
df = read_frame_edc(model_cls.objects.all())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edc_model_to_dataframe-1.0.1.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

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

edc_model_to_dataframe-1.0.1-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file edc_model_to_dataframe-1.0.1.tar.gz.

File metadata

  • Download URL: edc_model_to_dataframe-1.0.1.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for edc_model_to_dataframe-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bf428baf14b168279e50bfbce4ef73a529facf9490731aa7eaef803ac990961a
MD5 6c3eec028f95bd8769de0e14b39cb890
BLAKE2b-256 67df256edd079984440dd75b4d9f5745a1d5e1f0fccd7ed6b9135029c81b8c29

See more details on using hashes here.

File details

Details for the file edc_model_to_dataframe-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for edc_model_to_dataframe-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3fdf606098e952108a6f000dc58dffa87aaa70a7fca615489ec7316a744bcc5d
MD5 a2252cb34ed7ce8ce0f302cd74004870
BLAKE2b-256 2b14ad8cbe66f5ce93cdb5ee4c66941fde0a7497c7fff142ab8a9985cbd79b08

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