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 details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

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

Uploaded Python 2

File details

Details for the file soupstars-1.2.0.tar.gz.

File metadata

  • Download URL: soupstars-1.2.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.14

File hashes

Hashes for soupstars-1.2.0.tar.gz
Algorithm Hash digest
SHA256 507315db28e93ae73daadbb35ad0bed3e4d14feb658285842cfdf8afba1f59f0
MD5 c74e116cca66dbf9ba3995da14c0d4c8
BLAKE2b-256 b9fcb3ed6d13f9c14391e524071be98055187bf191fe758e7baa351f1ad8f310

See more details on using hashes here.

File details

Details for the file soupstars-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: soupstars-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for soupstars-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e51ffcf72c9b721afce0304c9866eff05d9db554733e4a89225f31de4d0e3d3b
MD5 5f6586c4860315306864a70f9ead7229
BLAKE2b-256 0c45162bacb113b24d8dd5af3e57dea59f833e8f4abdfad31700efa80a9c6c33

See more details on using hashes here.

File details

Details for the file soupstars-1.2.0-py2-none-any.whl.

File metadata

  • Download URL: soupstars-1.2.0-py2-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.14

File hashes

Hashes for soupstars-1.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 04d077d9d4ae55da24e9f22aa856e1851eae04e9c1405d2c56b48139f6f2eb00
MD5 407ab58aed6a6fa896e554ae7272e0ed
BLAKE2b-256 54d6be28c5a9bceeede6ba081b25c4e7fa191f00c1c785e7a58e947eded28376

See more details on using hashes here.

Supported by

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