Skip to main content

PureHTML

PureHTML is a parsing specification for extracting JSON from HTML.

Installation:

To install PureHTML, you can use pip with following command:

  pip install purehtml-purescraps

Usage

from purehtml import ConfigFactory, extract

yaml_string = """
selector: span
type: array
items: {}
"""
html_string = """
<div>
  <span>a</span>
  <span>b</span>
  <span>c</span>
</div>
"""
expected_output = "['a', 'b', 'c']"

config = ConfigFactory.from_yaml(yaml_string)

print(f"Extracted output : {extract(config, html_string, 'http://example.com')}")
print(f"Expected  output : {expected_output}")

Fallback Selectors & Transformer Quoting

PureHTML schemas allow resilient scraping with fallback selectors and parameter quoting:

# Fallback selectors for A/B tested DOM structures
selector:
  - .flash-deal
  - .sale-price
  - .regular-price

# Quoted transformer arguments containing spaces, commas, or regex escapes
transform:
  - 'replace("\\s+", " ")'
  - 'split(", ")'
  - 'join(" - ")'

Development

For testing, we use test specifications defined in <purehtml root>/specs. You may run python3 run_tests.py to check if the python implementation is working correctly or has some incompatibilities.

Building

  1. Install build pip with this command: python3 -m pip install --upgrade build
  2. Execute make clean build to create a clean build output. The output will be placed in dist/

Publishing to Python Package Index

  1. Install the twine package: python3 -m pip install --upgrade twine
  2. Publish to pypi: python3 -m twine upload dist/* or with make publish

License

MIT

Metadata

Release files for purehtml-purescraps 0.1.5

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

Source distribution (sdist)

Source distribution for purehtml-purescraps 0.1.5
File Size Uploaded Provenance Actions
purehtml_purescraps-0.1.5.tar.gz 20.2 kB With provenance Details for purehtml_purescraps-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for purehtml-purescraps 0.1.5
File Interpreter ABI Platform Actions
purehtml_purescraps-0.1.5-py3-none-any.whl Python 3 none any Details for purehtml_purescraps-0.1.5-py3-none-any.whl

Total release size: 55.3 kB

Release files / purehtml_purescraps-0.1.5.tar.gz

Download URL purehtml_purescraps-0.1.5.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d00fb28093d053d2fb6ea9968666ec4bfcfe06de2465a3b0a4ecb6e4ac88aee2
BLAKE2b-256 checksum
How to use checksums
79c06302ea86c5ddfca60e3131802bfe094179244ac7bcad443b76e84ebbe62f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / purehtml_purescraps-0.1.5-py3-none-any.whl

Download URL purehtml_purescraps-0.1.5-py3-none-any.whl
Size 35.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d18e130cb4b237e309b487b91c8769ebbc54b2d95ee627e3bd5834d7e0711671
BLAKE2b-256 checksum
How to use checksums
a15b92500cab82b4e976982acc07df9d53b95803ec0d4ac31bbd9ee094536fd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for purehtml-purescraps 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for purehtml_purescraps-0.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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