{ "info": { "author": "Luca Foppiano", "author_email": "FOPPIANO.Luca@nims.go.jp", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.6" ], "description": "Python client for Grobid Quantities\n===================================\n\n.. image:: http://img.shields.io/:license-apache-blue.svg\n :target: http://www.apache.org/licenses/LICENSE-2.0.html\n\n.. image:: https://travis-ci.org/hirmeos/entity-fishing-client-python.svg?branch=master\n :target: https://travis-ci.org/hirmeos/entity-fishing-client-python\n\n\nPython client to query the `Grobid Quantities service API`_\nFor more information about Grobid Quantities, please check the `Grobid Quantities Documentation`_.\n\n.. _Grobid Quantities service API: http://github.com/kermitt2/grobid-quantities\n.. _Grobid Quantities Documentation: http://nerd.readthedocs.io\n\n\nInstallation\n------------\n\nThe client can be installed using `pip`:\n\n pip install grobid-quantities-python\n\nUsage\n-----\n\nProcess Text / PDF\n##################\n\n.. code-block:: python\n\n from grobid_quantities.quantities import QuantitiesClient\n client = QuantitiesClient(apiBase=server_url)\n\n\nTo process raw text:\n\n.. code-block:: python\n\n client.process_text(\n \"I lost two minutes\"\n )\n\nTo process PDF\n\n.. code-block:: python\n\n client.process_pdf(pdfFile)\n\n\nTo parse the measurements\n\n.. code-block:: python\n\n client.parse_measures(\"from\": \"10\", \"to\": \"20\", \"unit\": \"km\")\n\n\n\nThe response is a tuple where the first element is the status code and and the second element the response body as a dictionary.\nHere an example: \n\n.. code-block:: python\n\n (\n 200,\n {\n \"runtime\": 123,\n \"measurements\": [\n {\n \"type\": \"value\",\n \"quantity\": {\n \"type\": \"time\",\n \"rawValue\": \"two\",\n \"rawUnit\": {\n \"name\": \"minutes\",\n \"type\": \"time\",\n \"system\": \"non SI\",\n \"offsetStart\": 11,\n \"offsetEnd\": 18\n },\n \"parsedValue\": {\n \"numeric\": 2,\n \"structure\": {\n \"type\": \"ALPHABETIC\",\n \"formatted\": \"two\"\n },\n \"parsed\": \"two\"\n },\n \"normalizedQuantity\": 120,\n \"normalizedUnit\": {\n \"name\": \"s\",\n \"type\": \"time\",\n \"system\": \"SI base\"\n },\n \"offsetStart\": 7,\n \"offsetEnd\": 11\n }\n }\n ]\n }\n )\n\nBatch processing\n######################\nThe batch processing is implemented in the class ``QuantitiesBatch``.\nThe class can be instantiated by defining the entity-fishing url in the constructor, else the default one is used.\n\nTo run the processing, the method `process` requires the `input` directory, a callback and the number of threads/processes.\nThere is an already ready implementation in `script/batchSample.py`.\n\nTo run it:\n - under this work branch, prepare two folders: `input` which containing the input PDF files to be processed and `output` which collecting the processing result\n - we recommend to create a new virtualenv, activate it and install all the requirements needed in this virtual environment using `$ pip install -r /path/of/grobid-quantities-python-client/source/requirements.txt`\n - (temporarly, until this branch is not merged) install entity-fishing **multithread branch** in edit mode (`pip install -e /path/of/client-python/source`)\n - run it with `python runFile.py input output 5`", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lfoppiano/grobid-quantitites-python-client", "keywords": "measurements,text mining,tdm,grobid", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "grobid-quantities-client", "package_url": "https://pypi.org/project/grobid-quantities-client/", "platform": "", "project_url": "https://pypi.org/project/grobid-quantities-client/", "project_urls": { "Homepage": "https://github.com/lfoppiano/grobid-quantitites-python-client" }, "release_url": "https://pypi.org/project/grobid-quantities-client/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "A minimal client for grobid-quantities service.", "version": "0.2.1" }, "last_serial": 5236498, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "63658336ee70be9c669b0eac2111c541", "sha256": "4ab7b85f8da648b13191d401c916d9b7866d57138b7407394e9c269e50a44db8" }, "downloads": -1, "filename": "grobid-quantities-client-0.0.1.tar.gz", "has_sig": false, "md5_digest": "63658336ee70be9c669b0eac2111c541", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5972, "upload_time": "2019-04-10T07:16:37", "url": "https://files.pythonhosted.org/packages/fe/2f/35d0e5ba545c5c68e2d6013f4f65cd0b583b9201262dc6e7a94572172452/grobid-quantities-client-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "e34668d56b43bcccb8ba722ba709d77a", "sha256": "6409cd9f4806d53ab6219c1d0504b80e907ac268e7906e6bfd71537375c9b280" }, "downloads": -1, "filename": "grobid-quantities-client-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e34668d56b43bcccb8ba722ba709d77a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6028, "upload_time": "2019-04-10T07:16:39", "url": "https://files.pythonhosted.org/packages/6a/ea/c364d5fe9c239f35dd37278f43ed829feaf955b9cac9cc0f30e8b63145be/grobid-quantities-client-0.1.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f9f0404573a4bab06033209c20e17658", "sha256": "30839d22ee87c19c6c0f7d223a1b7622e3160f6d5ddd6486a629473b0a80e632" }, "downloads": -1, "filename": "grobid-quantities-client-0.2.1.tar.gz", "has_sig": false, "md5_digest": "f9f0404573a4bab06033209c20e17658", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6023, "upload_time": "2019-05-07T07:33:00", "url": "https://files.pythonhosted.org/packages/48/f4/a5a5c272f120dff40b52242fb30473cd1fe5d0f7243696586e6a224d7545/grobid-quantities-client-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f9f0404573a4bab06033209c20e17658", "sha256": "30839d22ee87c19c6c0f7d223a1b7622e3160f6d5ddd6486a629473b0a80e632" }, "downloads": -1, "filename": "grobid-quantities-client-0.2.1.tar.gz", "has_sig": false, "md5_digest": "f9f0404573a4bab06033209c20e17658", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6023, "upload_time": "2019-05-07T07:33:00", "url": "https://files.pythonhosted.org/packages/48/f4/a5a5c272f120dff40b52242fb30473cd1fe5d0f7243696586e6a224d7545/grobid-quantities-client-0.2.1.tar.gz" } ] }