Skip to main content

Campbells 🥫

A condensed web scraping library.

Install • Examples

Adapted from beautifulsoup4's inner package, then linted, refactored, reduced, and seasoned to taste.

Development

To run pre-commit checks and tests:

pre-commit run --all-files && pdm run python -m pytest

Examples

To parse a string as HTML, your reciple should call for CampbellsSoup:

from campbells import CampbellsSoup

html_str = "<html><body><p>Hello world!</p></body></html>"
soup = CampbellsSoup(html_str)

Installation

Campbells is available on PyPi:

pip install campbells

The dependencies needed to use html5lib and lxml parsers are not installed by default. They can be installed with:

  • pip install campbells[html5lib] to be able to use html5lib.
    • Pros: closest to how browsers parses web pages, very lenient, creates valid HTML5.
    • Cons: slowest parser.
  • pip install campbells[lxml] to be able to use lxml.
    • Pros: fastest parser.
    • Cons: heavier dependency (C extension).

Metadata

Release files for campbells 0.3.0

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

Source distribution (sdist)

Source distribution for campbells 0.3.0
File Size Uploaded
campbells-0.3.0.tar.gz 145.3 kB Details

Built distribution (wheel)

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

Total release size: 318.8 kB

Release files / campbells-0.3.0.tar.gz

Download URL campbells-0.3.0.tar.gz
Size 145.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b0c2e4d47e8f9eed71fbe1b44daacb7d950bdca877341b22dfe2aee3d3891654
BLAKE2b-256 checksum
How to use checksums
22d0319df779ad1fb74df055066ea003cc0e595a9a6bcb48eff60594067bc0a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.8.2 CPython/3.10.6

Release files / campbells-0.3.0-py3-none-any.whl

Download URL campbells-0.3.0-py3-none-any.whl
Size 173.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40b3bf04eb7ca46621b03b6c06329ce778344ecbdd484885b8f4ff2f178ffa8c
BLAKE2b-256 checksum
How to use checksums
90370d08f0064ce7a627ae97bafe39af3774fd45f5952bf65414613f3d7c9429
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.8.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

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