|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 <https://github.com/chrisdev/django-pandas>`__ ``read_frame``.
Pass a model name:
.. code-block:: python
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:
.. code-block:: python
# 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 <https://github.com/chrisdev/django-pandas>`__, there is a ``read_frame`` -like function which wraps ModelToDataframe
.. code-block:: python
from edc_model_to_dataframe import read_frame_edc
model_cls = django_apps.get_model(model)
df = read_frame_edc(model_cls.objects.all())
.. |pypi| image:: https://img.shields.io/pypi/v/edc-model-to-dataframe.svg
:target: https://pypi.python.org/pypi/edc-model-to-dataframe
.. |actions| image:: https://github.com/clinicedc/edc-model-to-dataframe/actions/workflows/build.yml/badge.svg
:target: https://github.com/clinicedc/edc-model-to-dataframe/actions/workflows/build.yml
.. |codecov| image:: https://codecov.io/gh/clinicedc/edc-model-to-dataframe/branch/develop/graph/badge.svg
:target: https://codecov.io/gh/clinicedc/edc-model-to-dataframe
.. |downloads| image:: https://pepy.tech/badge/edc-model-to-dataframe
:target: https://pepy.tech/project/edc-model-to-dataframe
Raw data
{
"_id": null,
"home_page": "https://github.com/clinicedc/edc-model-to-dataframe",
"name": "edc-model-to-dataframe",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "django Edc pandas dataframe CSV STATA DTA export, clinicedc, clinical trials",
"author": "Erik van Widenfelt",
"author_email": "ew2789@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d3/ba/4b46848b3d93a5dff4cdab5eb0f0d10f1ffe7cc3d8293782039c0e3d71e6/edc_model_to_dataframe-1.0.0.tar.gz",
"platform": null,
"description": "|pypi| |actions| |codecov| |downloads|\n\nedc-model-to-dataframe\n----------------------\n\n``ModelToDataframe`` exports EDC subject data into a pandas dataframe. On export it will add ``subject_identifier`` and\nvisit tracking columns specific to the EDC. Also, by default, encrypted fields are not exported.\n\nM2M columns are joined into a single field value delimited by comma.\n\nNote: If you are just exporting raw tables, use `django_pandas <https://github.com/chrisdev/django-pandas>`__ ``read_frame``.\n\n\nPass a model name:\n\n.. code-block:: python\n\n from django.apps import apps as django_apps\n from edc_model_to_dataframe import ModelToDataframe\n\n model = \"meta_subject.followupexaminiation\"\n m = ModelToDataframe(model)\n df = m.dataframe\n\nPass a queryset:\n\n.. code-block:: python\n\n # using a queryset\n model_cls = django_apps.get_model(\"meta_subject.followupexaminiation\")\n m = ModelToDataframe(model_cls.objects.all())\n df = m.dataframe\n\n\n``read_frame_edc``: like in `django_pandas <https://github.com/chrisdev/django-pandas>`__, there is a ``read_frame`` -like function which wraps ModelToDataframe\n\n\n.. code-block:: python\n\n from edc_model_to_dataframe import read_frame_edc\n\n model_cls = django_apps.get_model(model)\n df = read_frame_edc(model_cls.objects.all())\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/edc-model-to-dataframe.svg\n :target: https://pypi.python.org/pypi/edc-model-to-dataframe\n\n.. |actions| image:: https://github.com/clinicedc/edc-model-to-dataframe/actions/workflows/build.yml/badge.svg\n :target: https://github.com/clinicedc/edc-model-to-dataframe/actions/workflows/build.yml\n\n.. |codecov| image:: https://codecov.io/gh/clinicedc/edc-model-to-dataframe/branch/develop/graph/badge.svg\n :target: https://codecov.io/gh/clinicedc/edc-model-to-dataframe\n\n.. |downloads| image:: https://pepy.tech/badge/edc-model-to-dataframe\n :target: https://pepy.tech/project/edc-model-to-dataframe\n",
"bugtrack_url": null,
"license": "GPL license, see LICENSE",
"summary": "Export EDC model data to pandas dataframe for clinicedc/edc projects",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/clinicedc/edc-model-to-dataframe"
},
"split_keywords": [
"django edc pandas dataframe csv stata dta export",
" clinicedc",
" clinical trials"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "05bbe53bbd6d80395939de5309b382aad777cb2ecd646fd61459a1c57af7f686",
"md5": "6577875d3ae097916e28b9cc703800b7",
"sha256": "c01bbce1765a4a08ae3d31dfd22d78abf229066c180e5bf199094751c3f30b1a"
},
"downloads": -1,
"filename": "edc_model_to_dataframe-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6577875d3ae097916e28b9cc703800b7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 36679,
"upload_time": "2025-01-31T17:41:27",
"upload_time_iso_8601": "2025-01-31T17:41:27.371617Z",
"url": "https://files.pythonhosted.org/packages/05/bb/e53bbd6d80395939de5309b382aad777cb2ecd646fd61459a1c57af7f686/edc_model_to_dataframe-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d3ba4b46848b3d93a5dff4cdab5eb0f0d10f1ffe7cc3d8293782039c0e3d71e6",
"md5": "de2029f5a80539347aa6fbdfe958b151",
"sha256": "9be3fbbdd5895dfc64b8f43a3ab339bf639841b7030993914fb46266345d5a51"
},
"downloads": -1,
"filename": "edc_model_to_dataframe-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "de2029f5a80539347aa6fbdfe958b151",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 35925,
"upload_time": "2025-01-31T17:41:29",
"upload_time_iso_8601": "2025-01-31T17:41:29.485882Z",
"url": "https://files.pythonhosted.org/packages/d3/ba/4b46848b3d93a5dff4cdab5eb0f0d10f1ffe7cc3d8293782039c0e3d71e6/edc_model_to_dataframe-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-31 17:41:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "clinicedc",
"github_project": "edc-model-to-dataframe",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "edc-model-to-dataframe"
}