Skip to main content

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

Creating a parser

New parsers are created by typing soupstars create into a terminal, and supplying the name of a python module.

soupstars create myparser.py

Soup Stars will use a template parser to help you get started. This example creates a parser that extracts headlines from articles on the New York Times website.

from soupstars import data, follow

url = "https://www.nytimes.com"

@follow
def follow(url):
    return (url.domain == "www.nytimes.com") and (url.match("\d{4}\/\d{2}\/\d{2}"))

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

You can test that the parser functions correctly.

soupstars run myparser

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

Set up the containers.

docker-compose exec web flask s3 mb soupstars-archive
docker-compose exec web flask db upgrade
docker-compose exec web flask seed schedules
docker-compose exec web flask seed plans
docker-compose exec web flask seed user
docker-compose exec web flask seed parsers

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/*

Release files for soupstars 2.11.25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for soupstars 2.11.25
File Size Uploaded
soupstars-2.11.25.tar.gz 18.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for soupstars 2.11.25
File Interpreter ABI Platform
soupstars-2.11.25-py3-none-any.whl Python 3 none any Details

Total release size: 41.7 kB

Release files / soupstars-2.11.25.tar.gz

Download URL soupstars-2.11.25.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dd732cee88c354e341269c1a14926bdade5bf844de75148ac99cd371cc713b1a
BLAKE2b-256 checksum
How to use checksums
0e0a5a635306001f8a0a47254c409a74c7ce7fc9f3bc447c32e6f915e51d7366
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / soupstars-2.11.25-py3-none-any.whl

Download URL soupstars-2.11.25-py3-none-any.whl
Size 23.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fa69240a6f2563ed3b4c7ba4bdfd71ebba76e305dff6d6567ff6324201cf1d6
BLAKE2b-256 checksum
How to use checksums
c2665d45b4b0501888b0101ee40690f92a38412d561902d4acdc17f9030d557c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

2.11.25 This release

2 release files

2.10.6

2 release files

2.10.4

2 release files

2.10.3

2 release files

2.10.2

2 release files

2.10.1

2 release files

2.10.0

2 release files

2.9.0

2 release files

2.8.0

2 release files

2.7.0

2 release files

2.6.8

2 release files

2.6.7

2 release files

2.6.6

2 release files

2.6.5

2 release files

2.6.4

2 release files

2.6.3

2 release files

2.6.2

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.0

2 release files

1.2.0

3 release files

1.1.0

3 release files

1.0.6

3 release files

1.0.5

1 release file

1.0.4

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page