pyCrossVA
=========
.. image:: https://img.shields.io/pypi/pyversions/pycrossva
:target: https://pypi.org/project/pycrossva
.. image:: http://readthedocs.org/projects/pycrossva/badge/
:target: http://pycrossva.readthedocs.io/
.. image:: https://ci.appveyor.com/api/projects/status/d1b842ik4c95x47h?svg=true
:target: https://ci.appveyor.com/project/jarathomas/pycrossva
Simple Usage - Python
---------------------
The simplest way to get started with CrossVA is to invoke the ``transform`` function
with a default mapping, and the path to a csv containing your raw verbal autopsy
data.
.. code-block:: python
from pycrossva.transform import transform
transform(("2016WHOv151", "InterVA5"), "path/to/data.csv")
You can also call the transform function on a Pandas DataFrame, if you wanted to
read in and process the data before calling the function.
.. code-block:: python
from pycrossva.transform import transform
input_data = pd.read_csv("path/to/data.csv")
input_data = some_special_function(input_data)
final_data = transform(("2016WHOv151", "InterVA5"), input_data)
The transform function returns a Pandas DataFrame object. To write the Pandas DataFrame
to a csv, you can do:
.. code-block:: python
final_data.to_csv("filename.csv")
pyCrossVA is a python package for transforming verbal autopsy data collected using
the 2016 WHO VA instrument (v1.5.1, or v1.4.1), 2012 WHO VA instrument, and
the PHRMC short questionnaire into a format suitable for openVA.
The flagship function of this package is the transform() function, which
prepares raw data for use in a verbal autopsy algorithm. The user can either
choose to use a default mapping, or create a custom one of their own design. The
default mappings are listed in `Currently Supported`_ and can be invoked by
passing in a tuple as the mapping argument in ``("input", "output")`` format.
Command Line
------------
`pycrossva` also contains a command line tool, `pycrossva-transform` that acts as
a wrapper for the `transform` python function in the pycrossva
package. Once you have installed pycrossva, you can run this from the command
line in order to process verbal autopsy data without having to touch python code.
If you have multiple input files to process from the same input type (or source format) to the same
output type (or algorithm), you can run them all in a single command.
If no destination (--dst) is specified, the default behavior will be to write
the resulting data to a csv in the current working directory with a name in
the pattern of "output_type_from_src_mmddyy", where mmddyy is the current
date. If `dst` is a directory, then the result file will still have the
default name. If `dst` ends in '.csv' but multiple input files are given,
then the output files will be written to dst_1.csv, dst_2.csv, etc.
`pycrossva-transform` takes 3 positional arguments:
* `input_type`: source type of the input data (the special input type of 'AUTODETECT' specifies that the type should be detected automatically if possible)
* `output_type`: format of output data (which algorithm the data should be prepared for)
* `src`: filepath to the input data - can take multiple arguments, separated by a space
Examples:
.. code-block:: bash
$ pycrossva-transform 2012WHO InterVA4 path/to/mydata.csv
2012WHO 'path/to/my/data.csv' data prepared for InterVA4 and written to csv at 'my/current/directory/InterVA4_from_mydata_042319.csv'
$ pycrossva-transform 2012WHO InterVA4 path/to/mydata1.csv path/to/another/data2.csv --dst outputfolder
2012WHO 'path/to/mydata1.csv' data prepared for InterVA4 and written to csv at 'outputfolder/InterVA4_from_mydata1_042319.csv'
2012WHO 'path/to/another/data2.csv' data prepared for InterVA4 and written to csv at 'outputfolder/InterVA4_from_data2_042319.csv'
$ pycrossva-transform 2012WHO InterVA4 path/to/mydata1.csv path/to/another/data2.csv --dst outputfolder/results.csv
2012WHO 'path/to/mydata1.csv' data prepared for InterVA4 and written to csv at 'outputfolder/results_1.csv'
2012WHO 'path/to/another/data2.csv' data prepared for InterVA4 and written to csv at 'outputfolder/results_2.csv'
$ pycrossva-transform AUTODETECT InterVA4 path/to/mydata.csv
Detected input type: 2012WHO
2012WHO 'path/to/my/data.csv' data prepared for InterVA4 and written to csv at 'my/current/directory/InterVA4_from_mydata_042319.csv'
Running Tests
-------------
To run unit tests, first make sure all requirements are installed
pip install -r requirements.txt
Also make sure that pytest is installed
pip install pytest
Finally, run the tests
pip install . && cd pycrossva && python -m pytest --doctest-modules
Currently Supported
--------------------
Inputs
^^^^^^^
* 2016 WHO Questionnaire from ODK export, v1.5.1
* 2016 WHO Questionnaire from ODK export, v1.4.1
* 2012 WHO Questionnaire from ODK export
* PHRMC Shortened Questionnaire
Outputs
^^^^^^^^
* InSilicoVA
* InSilicoVA_2012
* InterVA4
* InterVA5
Roadmap
-------
This is an alpha version of package functionality, with only limited support.
Expanding outputs
^^^^^^^^^^^^^^^^^^
One component of moving to a production version will be to offer additional
mapping files to support more output formats. The package currently supports
mapping to the InterVA4 and InSilicoVA format.
The following is a list of
additional outputs for other algorithms to be supported in future versions:
* Tariff
* Tariff 2.0
Style
-----
This package was written using google style guide for Python and PEP8 standards.
Tests have been written using doctest.
Background
----------
About Verbal Autopsy
^^^^^^^^^^^^^^^^^^^^
From `Wikipedia <https://en.wikipedia.org/wiki/Verbal_autopsy>`_:
A verbal autopsy (VA) is a method of gathering health information about a deceased
individual to determine his or her cause of death. Health information and a
description of events prior to death are acquired from conversations or
interviews with a person or persons familiar with the deceased and analyzed by
health professional or computer algorithms to assign a probable cause of death.
Verbal autopsy is used in settings where most deaths are undocumented. Estimates
suggest a majority of the 60 million annual global deaths occur without medical
attention or official medical certification of the cause of death. The VA method
attempts to establish causes of death for previously undocumented subjects,
allowing scientists to analyze disease patterns and direct public health policy
decisions.
Noteworthy uses of the verbal autopsy method include the Million Death Study in
India, China's national program to document causes of death in rural areas, and
the Global Burden of Disease Study 2010.
License
--------
This package is licensed under the GNU GENERAL PUBLIC LICENSE (v3, 2007).
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Raw data
{
"_id": null,
"home_page": "",
"name": "pycrossva",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Jason Thomas <jarathomas@gmail.com>",
"keywords": "verbal autopsy,data preparation",
"author": "ekarpinskiMITRE, pkmitre, owentrigueros, Peter Choi, Yue Chu, Jason Thomas",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/c8/db/9fdf59cb9185a1ebd2454906c32d973c7686a54e3cd47c6b8e23b2500e9b/pycrossva-0.97.tar.gz",
"platform": null,
"description": "pyCrossVA\n=========\n\n.. image:: https://img.shields.io/pypi/pyversions/pycrossva\n :target: https://pypi.org/project/pycrossva\n.. image:: http://readthedocs.org/projects/pycrossva/badge/\n :target: http://pycrossva.readthedocs.io/\n.. image:: https://ci.appveyor.com/api/projects/status/d1b842ik4c95x47h?svg=true\n :target: https://ci.appveyor.com/project/jarathomas/pycrossva\n\n\nSimple Usage - Python\n---------------------\n\nThe simplest way to get started with CrossVA is to invoke the ``transform`` function\nwith a default mapping, and the path to a csv containing your raw verbal autopsy\ndata.\n\n.. code-block:: python\n\n from pycrossva.transform import transform\n\n transform((\"2016WHOv151\", \"InterVA5\"), \"path/to/data.csv\")\n\nYou can also call the transform function on a Pandas DataFrame, if you wanted to\nread in and process the data before calling the function.\n\n.. code-block:: python\n\n from pycrossva.transform import transform\n\n input_data = pd.read_csv(\"path/to/data.csv\")\n input_data = some_special_function(input_data)\n final_data = transform((\"2016WHOv151\", \"InterVA5\"), input_data)\n\nThe transform function returns a Pandas DataFrame object. To write the Pandas DataFrame\nto a csv, you can do:\n\n.. code-block:: python\n\n final_data.to_csv(\"filename.csv\")\n\npyCrossVA is a python package for transforming verbal autopsy data collected using\nthe 2016 WHO VA instrument (v1.5.1, or v1.4.1), 2012 WHO VA instrument, and\nthe PHRMC short questionnaire into a format suitable for openVA.\n\nThe flagship function of this package is the transform() function, which\nprepares raw data for use in a verbal autopsy algorithm. The user can either\nchoose to use a default mapping, or create a custom one of their own design. The\ndefault mappings are listed in `Currently Supported`_ and can be invoked by\npassing in a tuple as the mapping argument in ``(\"input\", \"output\")`` format.\n\n\nCommand Line\n------------\n\n`pycrossva` also contains a command line tool, `pycrossva-transform` that acts as\na wrapper for the `transform` python function in the pycrossva\npackage. Once you have installed pycrossva, you can run this from the command\nline in order to process verbal autopsy data without having to touch python code.\nIf you have multiple input files to process from the same input type (or source format) to the same\noutput type (or algorithm), you can run them all in a single command.\n\nIf no destination (--dst) is specified, the default behavior will be to write\nthe resulting data to a csv in the current working directory with a name in\nthe pattern of \"output_type_from_src_mmddyy\", where mmddyy is the current\ndate. If `dst` is a directory, then the result file will still have the\ndefault name. If `dst` ends in '.csv' but multiple input files are given,\nthen the output files will be written to dst_1.csv, dst_2.csv, etc.\n\n`pycrossva-transform` takes 3 positional arguments:\n * `input_type`: source type of the input data (the special input type of 'AUTODETECT' specifies that the type should be detected automatically if possible)\n * `output_type`: format of output data (which algorithm the data should be prepared for)\n * `src`: filepath to the input data - can take multiple arguments, separated by a space\n\nExamples:\n\n.. code-block:: bash\n\n $ pycrossva-transform 2012WHO InterVA4 path/to/mydata.csv\n 2012WHO 'path/to/my/data.csv' data prepared for InterVA4 and written to csv at 'my/current/directory/InterVA4_from_mydata_042319.csv'\n\n $ pycrossva-transform 2012WHO InterVA4 path/to/mydata1.csv path/to/another/data2.csv --dst outputfolder\n 2012WHO 'path/to/mydata1.csv' data prepared for InterVA4 and written to csv at 'outputfolder/InterVA4_from_mydata1_042319.csv'\n 2012WHO 'path/to/another/data2.csv' data prepared for InterVA4 and written to csv at 'outputfolder/InterVA4_from_data2_042319.csv'\n\n $ pycrossva-transform 2012WHO InterVA4 path/to/mydata1.csv path/to/another/data2.csv --dst outputfolder/results.csv\n 2012WHO 'path/to/mydata1.csv' data prepared for InterVA4 and written to csv at 'outputfolder/results_1.csv'\n 2012WHO 'path/to/another/data2.csv' data prepared for InterVA4 and written to csv at 'outputfolder/results_2.csv'\n\n $ pycrossva-transform AUTODETECT InterVA4 path/to/mydata.csv\n Detected input type: 2012WHO\n 2012WHO 'path/to/my/data.csv' data prepared for InterVA4 and written to csv at 'my/current/directory/InterVA4_from_mydata_042319.csv'\n\n\nRunning Tests\n-------------\n\nTo run unit tests, first make sure all requirements are installed\n\n pip install -r requirements.txt\n\nAlso make sure that pytest is installed\n\n pip install pytest\n\nFinally, run the tests\n\n pip install . && cd pycrossva && python -m pytest --doctest-modules\n\nCurrently Supported\n--------------------\n\nInputs\n^^^^^^^\n\n* 2016 WHO Questionnaire from ODK export, v1.5.1\n* 2016 WHO Questionnaire from ODK export, v1.4.1\n* 2012 WHO Questionnaire from ODK export\n* PHRMC Shortened Questionnaire\n\nOutputs\n^^^^^^^^\n\n* InSilicoVA\n* InSilicoVA_2012\n* InterVA4\n* InterVA5\n\nRoadmap\n-------\n\nThis is an alpha version of package functionality, with only limited support.\n\nExpanding outputs\n^^^^^^^^^^^^^^^^^^\n\nOne component of moving to a production version will be to offer additional\nmapping files to support more output formats. The package currently supports\nmapping to the InterVA4 and InSilicoVA format.\n\nThe following is a list of\nadditional outputs for other algorithms to be supported in future versions:\n\n* Tariff\n* Tariff 2.0\n\nStyle\n-----\n\nThis package was written using google style guide for Python and PEP8 standards.\nTests have been written using doctest.\n\nBackground\n----------\n\nAbout Verbal Autopsy\n^^^^^^^^^^^^^^^^^^^^\n\nFrom `Wikipedia <https://en.wikipedia.org/wiki/Verbal_autopsy>`_:\n\n A verbal autopsy (VA) is a method of gathering health information about a deceased\n individual to determine his or her cause of death. Health information and a\n description of events prior to death are acquired from conversations or\n interviews with a person or persons familiar with the deceased and analyzed by\n health professional or computer algorithms to assign a probable cause of death.\n\n Verbal autopsy is used in settings where most deaths are undocumented. Estimates\n suggest a majority of the 60 million annual global deaths occur without medical\n attention or official medical certification of the cause of death. The VA method\n attempts to establish causes of death for previously undocumented subjects,\n allowing scientists to analyze disease patterns and direct public health policy\n decisions.\n\n Noteworthy uses of the verbal autopsy method include the Million Death Study in\n India, China's national program to document causes of death in rural areas, and\n the Global Burden of Disease Study 2010.\n\n\nLicense\n--------\n\nThis package is licensed under the GNU GENERAL PUBLIC LICENSE (v3, 2007).\nEveryone is permitted to copy and distribute verbatim copies\nof this license document, but changing it is not allowed.\n",
"bugtrack_url": null,
"license": "",
"summary": "Prepare data from WHO and PHRMC instruments for verbal autopsy algorithms",
"version": "0.97",
"project_urls": {
"Bug Tracker": "https://github.com/verbal-autopsy-software/pyCrossVA/issues",
"Homepage": "https://github.com/verbal-autopsy-software/pyCrossVA"
},
"split_keywords": [
"verbal autopsy",
"data preparation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "75b538a9a301c3ffddf5c0026548b87b93ad8468ceda8321d04bcd9df4d4fa41",
"md5": "8ce7a5e427b74358e011c673ae5ef7bd",
"sha256": "66975b775c79e3f1eb192c322b0a7675af7d0b6667c29c55f0d8588c772d06b6"
},
"downloads": -1,
"filename": "pycrossva-0.97-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8ce7a5e427b74358e011c673ae5ef7bd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 725363,
"upload_time": "2023-08-25T14:42:53",
"upload_time_iso_8601": "2023-08-25T14:42:53.230781Z",
"url": "https://files.pythonhosted.org/packages/75/b5/38a9a301c3ffddf5c0026548b87b93ad8468ceda8321d04bcd9df4d4fa41/pycrossva-0.97-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c8db9fdf59cb9185a1ebd2454906c32d973c7686a54e3cd47c6b8e23b2500e9b",
"md5": "f372e1374f79c9097c0efd06991f80e1",
"sha256": "264fd3d337e4ccd8d9323e98651a9eb3c088953cefa221b7eb531513e26d4d03"
},
"downloads": -1,
"filename": "pycrossva-0.97.tar.gz",
"has_sig": false,
"md5_digest": "f372e1374f79c9097c0efd06991f80e1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 656194,
"upload_time": "2023-08-25T14:42:55",
"upload_time_iso_8601": "2023-08-25T14:42:55.642320Z",
"url": "https://files.pythonhosted.org/packages/c8/db/9fdf59cb9185a1ebd2454906c32d973c7686a54e3cd47c6b8e23b2500e9b/pycrossva-0.97.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-25 14:42:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "verbal-autopsy-software",
"github_project": "pyCrossVA",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"appveyor": true,
"requirements": [
{
"name": "pandas",
"specs": [
[
">=",
"1.1.5"
]
]
},
{
"name": "numpy",
"specs": [
[
">=",
"1.15.4"
]
]
},
{
"name": "Click",
"specs": [
[
">=",
"7.0"
]
]
}
],
"tox": true,
"lcname": "pycrossva"
}