Skip to main content

Declarative web parsers

Project description

Soupstars :stew: :star: :boom:

Build Status Coverage Status Docs Version Image

Soupstars makes it easier than ever to build web parsers in Python.

Install it with pip.

pip install soupstars

Let's go!

Quickstart

You need two objects to get started.

>>> from soupstars import Parser, serialize

We'll build a parser to extract data from a github page.

>>> class GithubParser(Parser):
...    "Parse data from a github page"
...
...    @serialize
...    def title(self):
...        return str(self.h1.text.strip())

Now all we need is a github web page to parse.

>>> parser = GithubParser("https://github.com/tjwaterman99/soupstars")

Let's see what we've got!

>>> parser.to_dict()
{'title': 'tjwaterman99/soupstars'}

You're now ready to start building your own web parsers with soupstars. Nice job. :beers:

Going further

Contributing

We're thrilled you asked! Just open a PR on github, and we'll take a look.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

soupstars-1.2.0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distributions

soupstars-1.2.0-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

soupstars-1.2.0-py2-none-any.whl (7.8 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page