/mercupy-parser

Python wrapper for mercury-parser

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

MercuPy Parser

Python wrapper for mercury-parser

Installation

docker-compose.yml contains the configuration to run mercury-parser with nginx.

docker-compose up -d --scale mercury-parser=n

where n is the number of instances of mercury-parser

Then you can access the service at http://localhost:4000.

pip install mercupy-parser

Usage

from mercupy_parser import Mercupy

# api_endpoint = "http://localhost:4000/parser"
mercupy = Mercupy(api_endpoint=api_endpoint, verbose=True)

# parse single url
responses = mercupy.parser(url, headers=headers, content_type=content_type)

# parse multiple urls
responses = mercupy.parser(urls, headers=headers, content_type=content_type)

print(responses[0].json())