pytrials


Namepytrials JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/jvfe/pytrials
SummaryPython wrapper around the clinicaltrials.gov API
upload_time2023-07-09 18:08:36
maintainer
docs_urlNone
authorJoão Vitor F. Cavalcante
requires_python>=3.7
licenseBSD license
keywords pytrials clinical-trials clinical trials tabular text-mining text opendata
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ========
pytrials
========


.. image:: https://img.shields.io/pypi/v/pytrials.svg
        :target: https://pypi.python.org/pypi/pytrials

.. image:: https://github.com/jvfe/pytrials/workflows/pytest/badge.svg
        :target: https://github.com/jvfe/pytrials/actions

.. image:: https://img.shields.io/pypi/l/pytrials
        :target: https://github.com/jvfe/pytrials/blob/master/LICENSE

.. image:: https://readthedocs.org/projects/pytrials/badge/?version=latest
        :target: https://pytrials.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status




Python wrapper around the clinicaltrials.gov API.
Documentation for the API can be found here: https://clinicaltrials.gov/api/


* Free software: BSD license
* Documentation: https://pytrials.readthedocs.io.


Tutorial
--------
To install::

    $ pip install pytrials

Basic Usage
^^^^^^^^^^^
::

    from pytrials.client import ClinicalTrials

    ct = ClinicalTrials()

    # Get 50 full studies related to Coronavirus and COVID in json format.
    ct.get_full_studies(search_expr="Coronavirus+COVID", max_studies=50)

    # Get the NCTId, Condition and Brief title fields from 500 studies related to Coronavirus and Covid, in csv format.
    corona_fields = ct.get_study_fields(
        search_expr="Coronavirus+COVID",
        fields=["NCTId", "Condition", "BriefTitle"],
        max_studies=500,
        fmt="csv",
    )

    # Get the count of studies related to Coronavirus and COVID.
    # ClinicalTrials limits API queries to 1000 records
    # Count of studies may be useful to build loops when you want to retrieve more than 1000 records

    ct.get_study_count(search_expr="Coronavirus+COVID")

    # Read the csv data in Pandas
    import pandas as pd

    pd.DataFrame.from_records(corona_fields[1:], columns=corona_fields[0])

Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


=======
History
=======

0.1.0 (2020-07-06)
------------------

* First release on PyPI.

0.1.2 (2020-07-11)
------------------

* Minor fixes

0.2.0 (2021-04-24)
------------------

* Improved test suite
* Added get_study_count function

0.2.1 (2023-07-09)
------------------

* Add classic prefix to url - #10
* Raise error if API status is not ok - #11

0.3.0 (2023-07-09)
------------------

* Add min_rnk option to get_study_fields - #12

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jvfe/pytrials",
    "name": "pytrials",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "pytrials clinical-trials clinical trials tabular text-mining text opendata",
    "author": "Jo\u00e3o Vitor F. Cavalcante",
    "author_email": "jvfe@ufrn.edu.br",
    "download_url": "https://files.pythonhosted.org/packages/56/ea/a8ea6fdb1eb911b6513cf1ebb832b90f107d595ee52393d4146f5b5aab27/pytrials-0.3.0.tar.gz",
    "platform": null,
    "description": "========\npytrials\n========\n\n\n.. image:: https://img.shields.io/pypi/v/pytrials.svg\n        :target: https://pypi.python.org/pypi/pytrials\n\n.. image:: https://github.com/jvfe/pytrials/workflows/pytest/badge.svg\n        :target: https://github.com/jvfe/pytrials/actions\n\n.. image:: https://img.shields.io/pypi/l/pytrials\n        :target: https://github.com/jvfe/pytrials/blob/master/LICENSE\n\n.. image:: https://readthedocs.org/projects/pytrials/badge/?version=latest\n        :target: https://pytrials.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n\n\n\nPython wrapper around the clinicaltrials.gov API.\nDocumentation for the API can be found here: https://clinicaltrials.gov/api/\n\n\n* Free software: BSD license\n* Documentation: https://pytrials.readthedocs.io.\n\n\nTutorial\n--------\nTo install::\n\n    $ pip install pytrials\n\nBasic Usage\n^^^^^^^^^^^\n::\n\n    from pytrials.client import ClinicalTrials\n\n    ct = ClinicalTrials()\n\n    # Get 50 full studies related to Coronavirus and COVID in json format.\n    ct.get_full_studies(search_expr=\"Coronavirus+COVID\", max_studies=50)\n\n    # Get the NCTId, Condition and Brief title fields from 500 studies related to Coronavirus and Covid, in csv format.\n    corona_fields = ct.get_study_fields(\n        search_expr=\"Coronavirus+COVID\",\n        fields=[\"NCTId\", \"Condition\", \"BriefTitle\"],\n        max_studies=500,\n        fmt=\"csv\",\n    )\n\n    # Get the count of studies related to Coronavirus and COVID.\n    # ClinicalTrials limits API queries to 1000 records\n    # Count of studies may be useful to build loops when you want to retrieve more than 1000 records\n\n    ct.get_study_count(search_expr=\"Coronavirus+COVID\")\n\n    # Read the csv data in Pandas\n    import pandas as pd\n\n    pd.DataFrame.from_records(corona_fields[1:], columns=corona_fields[0])\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\n0.1.0 (2020-07-06)\n------------------\n\n* First release on PyPI.\n\n0.1.2 (2020-07-11)\n------------------\n\n* Minor fixes\n\n0.2.0 (2021-04-24)\n------------------\n\n* Improved test suite\n* Added get_study_count function\n\n0.2.1 (2023-07-09)\n------------------\n\n* Add classic prefix to url - #10\n* Raise error if API status is not ok - #11\n\n0.3.0 (2023-07-09)\n------------------\n\n* Add min_rnk option to get_study_fields - #12\n",
    "bugtrack_url": null,
    "license": "BSD license",
    "summary": "Python wrapper around the clinicaltrials.gov API",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/jvfe/pytrials"
    },
    "split_keywords": [
        "pytrials",
        "clinical-trials",
        "clinical",
        "trials",
        "tabular",
        "text-mining",
        "text",
        "opendata"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b68c1a6b3de56f7795d5bdf8b16e917485a61a1434b57d6acf5fe94e2ef8b8ea",
                "md5": "58768d69042675291872d68618c4ffb0",
                "sha256": "893e40ea4e350d3eb0352a41761fbb27269910ff2e1e3311a84100fbac28efda"
            },
            "downloads": -1,
            "filename": "pytrials-0.3.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "58768d69042675291872d68618c4ffb0",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.7",
            "size": 6307,
            "upload_time": "2023-07-09T18:08:34",
            "upload_time_iso_8601": "2023-07-09T18:08:34.564041Z",
            "url": "https://files.pythonhosted.org/packages/b6/8c/1a6b3de56f7795d5bdf8b16e917485a61a1434b57d6acf5fe94e2ef8b8ea/pytrials-0.3.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56eaa8ea6fdb1eb911b6513cf1ebb832b90f107d595ee52393d4146f5b5aab27",
                "md5": "7ad6d74cb3c2715fc0b63cabdc88ab41",
                "sha256": "a09104ee320b860346f406ce5a43490bbe60a8794d99ba4e1c4af321da94946e"
            },
            "downloads": -1,
            "filename": "pytrials-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7ad6d74cb3c2715fc0b63cabdc88ab41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12880,
            "upload_time": "2023-07-09T18:08:36",
            "upload_time_iso_8601": "2023-07-09T18:08:36.055807Z",
            "url": "https://files.pythonhosted.org/packages/56/ea/a8ea6fdb1eb911b6513cf1ebb832b90f107d595ee52393d4146f5b5aab27/pytrials-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-09 18:08:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jvfe",
    "github_project": "pytrials",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pytrials"
}
        
Elapsed time: 0.08737s