pyhpoapi


Namepyhpoapi JSON
Version 2.0.0 PyPI version JSON
download
home_page
SummaryA REST API for the HPO ontology using PyHPO
upload_time2023-07-28 19:56:48
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License
keywords hpo rest-api bioinformatics ontology phenotype
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            *********
PyHPO-API
*********

A HTTP REST-API wrapper for `PyHPO`_

Main features
=============
This package allows an easy setup of a REST API to interact with HPO Terms using the `PyHPO`_ package.


API Documentation
=================
To see an interactive API documentation, install PyHPO-API, run the app and visit http://127.0.0.1:8000/docs


Installation / Setup
====================

The easiest way to install PyHPO-API is via pip

.. code:: bash

    pip install pyhpoapi


.. note::

    **PyHPO-API** ships with ``pyhpo`` as the underlying Ontology by default. it is also possible to use `hpo3 <https://pypi.org/project/hpo3/>`_ instead. ``hpo3`` is a drop-in replacement of ``pyhpo`` written in Rust and is much faster. It is not 100% feature complete, so use it with caution. To switch to ``hpo3`` unintstall pyhpo and then install hpo3

    .. code:: bash

        pip uninstall -y pyhpo
        pip install hpo3


Usage
=====

Getting started
---------------
The easiest way to get started is to run the API via

.. code:: bash

    uvicorn pyhpoapi.main:app


Parallel processing
-------------------
If you want better performance for parallel request handling,
you can run PyHPO-API with multiple workers

.. code:: bash

    uvicorn pyhpoapi.main:app --workers 15 


.. note::

    Don't use more workers than available CPUs as it will backfire
    and slow down processing due to constant context-switches

CORS
----
If you need to allow cross-origin requests, you specify CORS settings through environment variables::

    export PYHPOAPI_CORS_ORIGINS="*"
    export PYHPOAPI_CORS_METHODS="GET,POST"
    export PYHPOAPI_CORS_HEADERS="*"


Dev
===

Getting started for development
-------------------------------
Clone the repository

.. code:: bash

    git clone https://github.com/anergictcell/pyhpoapi.git
    cd pyhpoapi


Use Docker for development
--------------------------
One way to do this is to run a docker container during development

.. code:: bash

    docker run --rm -v $(pwd):/src -p 8000:8000 -it python:3.9-slim-buster bash

    cd src
    pip3 install -r requirements.txt
    pip3 install -r requirements-dev.txt

    python3 -m unittest discover tests

    uvicorn --host 0.0.0.0 --reload pyhpoapi.main:app


Or local development without Docker
-----------------------------------

Create a virtual environment and install requirements in the virtual environment


.. code:: bash

    virtualenv venv_pyhpoapi
    source venv_pyhpoapi/bin/activate

    pip3 install -r requirements.txt
    pip3 install -r requirements-dev.txt

    python3 -m unittest discover tests

    uvicorn --reload pyhpoapi.main:app


.. _PyHPO: https://github.com/Centogene/pyhpo



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pyhpoapi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "HPO,REST-API,Bioinformatics,Ontology,Phenotype",
    "author": "",
    "author_email": "Jonas Marcello <jonas.marcello@esbme.com>",
    "download_url": "https://files.pythonhosted.org/packages/78/f6/e91d1311af377afb952089a19ef6cc5733707f41c5275bc67473970c38ac/pyhpoapi-2.0.0.tar.gz",
    "platform": null,
    "description": "*********\nPyHPO-API\n*********\n\nA HTTP REST-API wrapper for `PyHPO`_\n\nMain features\n=============\nThis package allows an easy setup of a REST API to interact with HPO Terms using the `PyHPO`_ package.\n\n\nAPI Documentation\n=================\nTo see an interactive API documentation, install PyHPO-API, run the app and visit http://127.0.0.1:8000/docs\n\n\nInstallation / Setup\n====================\n\nThe easiest way to install PyHPO-API is via pip\n\n.. code:: bash\n\n    pip install pyhpoapi\n\n\n.. note::\n\n    **PyHPO-API** ships with ``pyhpo`` as the underlying Ontology by default. it is also possible to use `hpo3 <https://pypi.org/project/hpo3/>`_ instead. ``hpo3`` is a drop-in replacement of ``pyhpo`` written in Rust and is much faster. It is not 100% feature complete, so use it with caution. To switch to ``hpo3`` unintstall pyhpo and then install hpo3\n\n    .. code:: bash\n\n        pip uninstall -y pyhpo\n        pip install hpo3\n\n\nUsage\n=====\n\nGetting started\n---------------\nThe easiest way to get started is to run the API via\n\n.. code:: bash\n\n    uvicorn pyhpoapi.main:app\n\n\nParallel processing\n-------------------\nIf you want better performance for parallel request handling,\nyou can run PyHPO-API with multiple workers\n\n.. code:: bash\n\n    uvicorn pyhpoapi.main:app --workers 15 \n\n\n.. note::\n\n    Don't use more workers than available CPUs as it will backfire\n    and slow down processing due to constant context-switches\n\nCORS\n----\nIf you need to allow cross-origin requests, you specify CORS settings through environment variables::\n\n    export PYHPOAPI_CORS_ORIGINS=\"*\"\n    export PYHPOAPI_CORS_METHODS=\"GET,POST\"\n    export PYHPOAPI_CORS_HEADERS=\"*\"\n\n\nDev\n===\n\nGetting started for development\n-------------------------------\nClone the repository\n\n.. code:: bash\n\n    git clone https://github.com/anergictcell/pyhpoapi.git\n    cd pyhpoapi\n\n\nUse Docker for development\n--------------------------\nOne way to do this is to run a docker container during development\n\n.. code:: bash\n\n    docker run --rm -v $(pwd):/src -p 8000:8000 -it python:3.9-slim-buster bash\n\n    cd src\n    pip3 install -r requirements.txt\n    pip3 install -r requirements-dev.txt\n\n    python3 -m unittest discover tests\n\n    uvicorn --host 0.0.0.0 --reload pyhpoapi.main:app\n\n\nOr local development without Docker\n-----------------------------------\n\nCreate a virtual environment and install requirements in the virtual environment\n\n\n.. code:: bash\n\n    virtualenv venv_pyhpoapi\n    source venv_pyhpoapi/bin/activate\n\n    pip3 install -r requirements.txt\n    pip3 install -r requirements-dev.txt\n\n    python3 -m unittest discover tests\n\n    uvicorn --reload pyhpoapi.main:app\n\n\n.. _PyHPO: https://github.com/Centogene/pyhpo\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A REST API for the HPO ontology using PyHPO",
    "version": "2.0.0",
    "project_urls": null,
    "split_keywords": [
        "hpo",
        "rest-api",
        "bioinformatics",
        "ontology",
        "phenotype"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a5dd1a5b5ff212bcf746a1c2e3297549c6e63cda4a98d801aaf61fd5c6d8103f",
                "md5": "de54e4c5764102012d50acff33724fc0",
                "sha256": "084b57ea12056f30846c1d061e9cdce16aca0bfd1b0ef7be69c75b908014cf4e"
            },
            "downloads": -1,
            "filename": "pyhpoapi-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "de54e4c5764102012d50acff33724fc0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 44480,
            "upload_time": "2023-07-28T19:56:47",
            "upload_time_iso_8601": "2023-07-28T19:56:47.089988Z",
            "url": "https://files.pythonhosted.org/packages/a5/dd/1a5b5ff212bcf746a1c2e3297549c6e63cda4a98d801aaf61fd5c6d8103f/pyhpoapi-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "78f6e91d1311af377afb952089a19ef6cc5733707f41c5275bc67473970c38ac",
                "md5": "9d7e276e69c98bd3d6fad925f915bbf5",
                "sha256": "edd7ebac21a233008f28fd4a73e31e0b8c950fd18e3a365d1e516ab2867bd2b9"
            },
            "downloads": -1,
            "filename": "pyhpoapi-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9d7e276e69c98bd3d6fad925f915bbf5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 44601,
            "upload_time": "2023-07-28T19:56:48",
            "upload_time_iso_8601": "2023-07-28T19:56:48.767642Z",
            "url": "https://files.pythonhosted.org/packages/78/f6/e91d1311af377afb952089a19ef6cc5733707f41c5275bc67473970c38ac/pyhpoapi-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-28 19:56:48",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pyhpoapi"
}
        
Elapsed time: 0.09682s