{
"info": {
"author": "Fernando Macedo",
"author_email": "fgmacedo@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "========\nraspador\n========\n\n.. image:: https://api.travis-ci.org/fgmacedo/raspador.png?branch=master\n :target: https://travis-ci.org/fgmacedo/raspador\n\n.. image:: https://coveralls.io/repos/fgmacedo/raspador/badge.png\n :target: https://coveralls.io/r/fgmacedo/raspador\n\n.. image:: https://pypip.in/v/raspador/badge.png\n :target: https://pypi.python.org/pypi/raspador\n\n.. image:: https://pypip.in/d/raspador/badge.png\n :target: https://crate.io/packages/raspador/\n\n\nLibrary to extract data from semi-structured text documents.\n\nIt's best suited for data-processing in files that do not have a formal\nstructure and are in plain text (or that are easy to convert). Structured files\nlike XML, CSV and HTML doesn't fit a good use case for Raspador, and have\nexcellent alternatives to get data extracted, like lxml_, html5lib_,\nBeautifulSoup_, and PyQuery_.\n\nThe extractors are defined through classes as models, something similar to the\nDjango ORM. Each field searches for a pattern specified by the regular\nexpression, and captured groups are converted automatically to primitives.\n\nThe parser is implemented as a generator, where each item found can be consumed\nbefore the end of the analysis, featuring a pipeline.\n\nThe analysis is forward-only, which makes it extremely quick, and thus any\niterator that returns a string can be analyzed, including infinite streams.\n\n.. _lxml: http://lxml.de\n.. _html5lib: https://github.com/html5lib/html5lib-python\n.. _BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/\n.. _PyQuery: https://github.com/gawel/pyquery/\n\n\nInstall\n=======\n\nRaspador works on CPython 2.6+, CPython 3.2+ and PyPy. To install it, use::\n\n pip install raspador\n\nor easy install::\n\n easy_install raspador\n\n\nFrom source\n-----------\n\nDownload and install from source::\n\n git clone https://github.com/fgmacedo/raspador.git\n cd raspador\n python setup.py install\n\n\nDependencies\n------------\n\nThere are no external dependencies.\n\n.. note:: Python 2.6\n\n With Python 2.6, you must install `ordereddict\n `_.\n\n You can install it with pip::\n\n pip install ordereddict\n\nTests\n======\n\nTo automate tests with all supported Python versions at once, we use `tox\n`_.\n\nRun all tests with:\n\n.. code-block:: bash\n\n $ tox\n\nTests depend on several third party libraries, but these are installed by tox\non each Python's virtualenv:\n\n.. code-block:: text\n\n nose==1.3.0\n coverage==3.6\n flake8==2.0\n\n\nExamples\n========\n\nExtract data from logs\n----------------------\n\n.. code-block:: python\n\n from __future__ import print_function\n import json\n from raspador import Parser, StringField\n\n out = \"\"\"\n PART:/dev/sda1 UUID:423k34-3423lk423-sdfsd-43 TYPE:ext4\n PART:/dev/sda2 UUID:74928389-852893-sdfdf-g8 TYPE:ext4\n PART:/dev/sda3 UUID:sdkj9d93-sdf9df-3kr3l-d8 TYPE:swap\n \"\"\"\n\n\n class LogParser(Parser):\n begin = r'^PART.*'\n end = r'^PART.*'\n PART = StringField(r'PART:([^\\s]+)')\n UUID = StringField(r'UUID:([^\\s]+)')\n TYPE = StringField(r'TYPE:([^\\s]+)')\n\n\n a = LogParser()\n\n # res is a generator\n res = a.parse(iter(out.splitlines()))\n\n out_as_json = json.dumps(list(res), indent=2)\n print (out_as_json)\n\n # Output:\n \"\"\"\n [\n {\n \"PART\": \"/dev/sda1\",\n \"TYPE\": \"ext4\",\n \"UUID\": \"423k34-3423lk423-sdfsd-43\"\n },\n {\n \"PART\": \"/dev/sda2\",\n \"TYPE\": \"ext4\",\n \"UUID\": \"74928389-852893-sdfdf-g8\"\n },\n {\n \"PART\": \"/dev/sda3\",\n \"TYPE\": \"swap\",\n \"UUID\": \"sdkj9d93-sdf9df-3kr3l-d8\"\n }\n ]\n \"\"\"",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://github.org/fgmacedo/raspador",
"keywords": null,
"license": "MIT",
"maintainer": null,
"maintainer_email": null,
"name": "raspador",
"package_url": "https://pypi.org/project/raspador/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/raspador/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://github.org/fgmacedo/raspador"
},
"release_url": "https://pypi.org/project/raspador/0.2.2/",
"requires_dist": null,
"requires_python": null,
"summary": "Library to extract data from semi-structured text documents",
"version": "0.2.2"
},
"last_serial": 907359,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "ba08f51195fd87951ac39c54e38672e6",
"sha256": "01d2e23be7033fb632dfa0eb38be6506be863b22b2049aa7af65592e65c1e5d4"
},
"downloads": -1,
"filename": "raspador-0.1.0.zip",
"has_sig": false,
"md5_digest": "ba08f51195fd87951ac39c54e38672e6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7989,
"upload_time": "2013-08-09T19:43:43",
"url": "https://files.pythonhosted.org/packages/13/ee/6c42c73898712c0a5f14d63bebcc4a8f3192753de3ddc6e8fc2448b7436f/raspador-0.1.0.zip"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "7e0d1d333f8c08d50a2c58122aab104f",
"sha256": "9bf31924412c19047d01d7ae48af76c04814219016092d93e832fa8e683ac74c"
},
"downloads": -1,
"filename": "raspador-0.1.1.zip",
"has_sig": false,
"md5_digest": "7e0d1d333f8c08d50a2c58122aab104f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8257,
"upload_time": "2013-08-09T22:11:13",
"url": "https://files.pythonhosted.org/packages/0a/6d/b7abed5720c4b9cb2f6702197e9e4194bc3d0f80c47b4822a16e477a5bd9/raspador-0.1.1.zip"
}
],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "d18fabe37c23a51551c2c13c99e1db97",
"sha256": "294460c34f7137c4b3b5e6330b98c484fe49340635d0984dff8694bb474c9881"
},
"downloads": -1,
"filename": "raspador-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "d18fabe37c23a51551c2c13c99e1db97",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7078,
"upload_time": "2013-08-17T18:22:19",
"url": "https://files.pythonhosted.org/packages/76/f2/e1d7378746b62111c031922034e3d1c2cb9802b8af26f0df95cdb8da7163/raspador-0.1.2.tar.gz"
}
],
"0.1.3": [
{
"comment_text": "",
"digests": {
"md5": "2e39a024998b36e4afacbe5f77d48fb0",
"sha256": "378918d9d01da72e6f46f39eee0f1a17f48b3c815e0d721b4a7f3a11f826a2ae"
},
"downloads": -1,
"filename": "raspador-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "2e39a024998b36e4afacbe5f77d48fb0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7820,
"upload_time": "2013-08-25T03:34:09",
"url": "https://files.pythonhosted.org/packages/1e/e6/3ad880b3097946d3fae47d1d7e9e69116b9c7627f26a452beb88309f0ab2/raspador-0.1.3.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "b8ed417d6fbadd4c9b87700d535af24b",
"sha256": "f86d28f5e6ff3304af106b526317ce591edd768b0c56b0f5da6a89caf4db5702"
},
"downloads": -1,
"filename": "raspador-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "b8ed417d6fbadd4c9b87700d535af24b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7816,
"upload_time": "2013-10-03T13:14:58",
"url": "https://files.pythonhosted.org/packages/cb/e4/f4bc4d3f256705138534787d9363d7964d1463350d70a2743870d4d2beed/raspador-0.2.0.tar.gz"
}
],
"0.2.1": [
{
"comment_text": "",
"digests": {
"md5": "e21520586f87a8be0b175469b6db74c8",
"sha256": "ca493a1a97cfd92457dc77d34fda1c791263f2d9cec25ef4a7e706aa5583de7b"
},
"downloads": -1,
"filename": "raspador-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "e21520586f87a8be0b175469b6db74c8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7828,
"upload_time": "2013-10-04T21:52:29",
"url": "https://files.pythonhosted.org/packages/3f/57/806bedc935d5e24186c76c7b64dc30130ec13595a544c582151592a69f40/raspador-0.2.1.tar.gz"
}
],
"0.2.2": [
{
"comment_text": "",
"digests": {
"md5": "1e235b68c7b1704ea7d0ffeeb8b24f46",
"sha256": "664cf4e6b1bd0ab60c4f5032d6aa6e0d221301bbadad067fc28f718af60efd94"
},
"downloads": -1,
"filename": "raspador-0.2.2.zip",
"has_sig": false,
"md5_digest": "1e235b68c7b1704ea7d0ffeeb8b24f46",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11825,
"upload_time": "2013-10-30T13:51:04",
"url": "https://files.pythonhosted.org/packages/8a/d5/3ff6ce348211782b047fb1649b943090ad68a2ae45a96ef9a26013024983/raspador-0.2.2.zip"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "1e235b68c7b1704ea7d0ffeeb8b24f46",
"sha256": "664cf4e6b1bd0ab60c4f5032d6aa6e0d221301bbadad067fc28f718af60efd94"
},
"downloads": -1,
"filename": "raspador-0.2.2.zip",
"has_sig": false,
"md5_digest": "1e235b68c7b1704ea7d0ffeeb8b24f46",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11825,
"upload_time": "2013-10-30T13:51:04",
"url": "https://files.pythonhosted.org/packages/8a/d5/3ff6ce348211782b047fb1649b943090ad68a2ae45a96ef9a26013024983/raspador-0.2.2.zip"
}
]
}