Skip to main content

Declarative web parsers

Project description

Soup Stars

Build Status

Version Python

Soup Stars is a framework for building web parsers with Python. It is designed to make building, deploying, and scheduling web parsers easier by simplifying what you need to get started.

Quickstart

pip install soupstars

The client is also available as a docker image.

docker pull soupstars/client

Building a parser

Create a new parser using the soupstars command. The create command will use a template parser.

soupstars create -m myparser.py

Parsers are simple python modules.

cat myparser.py

Notice that the only set up required is the special parse decorator and a variable named url for the web page you want to parse.

from soupstars import parse

url = "https://corbettanalytics.com/"

@parse
def h1(soup):
    return soup.h1.text

You can test that the parser functions correctly.

soupstars run -m myparser.py

Use soupstars --help to see a full list of available commands.

More documentation is available here.

Development

Start the docker services.

docker-compose up -d

Run the tests.

docker-compose run --rm client pytest -vs

Releasing

New tags that pass on CI will automatically be pushed to docker hub.

To deploy to PyPI requires manually running the following commands.

pip3 install twine
python3 setup.py sdist bdist_wheel
twine upload dist/*

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-2.11.13.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

soupstars-2.11.13-py2-none-any.whl (8.2 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: soupstars-2.11.13.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for soupstars-2.11.13.tar.gz
Algorithm Hash digest
SHA256 612ddceba2b7182c46cfbfccb311c6b3d280da3dcd98e079dcd5853debd0d956
MD5 78bdfe8380f0dcfe46625fe6107ee418
BLAKE2b-256 5cb03a557a5e514b8816f1667e7ab6118d7c9ad027ab89c7f482c27d0d807830

See more details on using hashes here.

File details

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

File metadata

  • Download URL: soupstars-2.11.13-py2-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for soupstars-2.11.13-py2-none-any.whl
Algorithm Hash digest
SHA256 237b42c913a277ec856eba0a1c52cc8372a614472c339166ee1e4b1eb1b03fb3
MD5 548178e6c9384d53f9d891eb371133ba
BLAKE2b-256 c47e3f5eb642b308401f788669a010317f0114f74fa95f95a697500a3f8ee44a

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