__all__ = ['process_pmc']

import logging
import requests

from .processor import RlimspProcessor


logger = logging.getLogger(__name__)


RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/pmc'


class RLIMSP_Error(Exception):
    pass


def process_pmc(pmc_id, with_grounding=True):
    """Get an output from RLIMS-p for the given pmic id."""
    if with_grounding:
        resp = requests.get(RLIMSP_URL + '.normed/pmcid/%s' % pmc_id)
    else:
        resp = requests.get(RLIMSP_URL + '/pmcid/%s' % pmc_id)

    if resp.status_code != 200:
        raise RLIMSP_Error("Bad status code: %d - %s"
                           % (resp.status_code, resp.reason))

    rp = RlimspProcessor(resp.json())

    return rp

@@ -280,17 +280,16 @@
 _pmc(pmc
-_
 id, with
@@ -362,16 +362,396 @@
 pmic id.
+%0A%0A    Parameters%0A    ----------%0A    pmcid : str%0A        A PMCID, with the prefix PMC, of the paper to be %22read%22.%0A    with_grounding : bool%0A        The RLIMS-P web service provides two endpoints, one pre-grounded, the%0A        other not so much. The grounded endpoint returns far less content, and%0A        may perform some grounding that can be handled by the grounding mapper.%0A    
 %22%22%22%0A    
@@ -830,25 +830,24 @@
 id/%25s' %25 pmc
-_
 id)%0A    else
@@ -906,17 +906,16 @@
 s' %25 pmc
-_
 id)%0A%0A   

Add more doc string to the api function.