HTML data extraction library
Project description
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}")
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
- Install
buildpip with this command:python3 -m pip install --upgrade build - Execute
make clean buildto create a clean build output. The output will be placed indist/
Publishing to Python Package Index
- Install the
twinepackage:python3 -m pip install --upgrade twine - Publish to pypi:
python3 -m twine upload dist/*or withmake publish
License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file purehtml_purescraps-0.1.3.tar.gz.
File metadata
- Download URL: purehtml_purescraps-0.1.3.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fad09103b57e228022e95721b74883fff258440bf5bb47d1fdf6796959065bc
|
|
| MD5 |
91a82ba246bdb970eb9e0d75c535b223
|
|
| BLAKE2b-256 |
6cac371c7ac625f5a1730366c3ebafdec9d4d09eaf62b9c60e13fb78fbab0119
|
Provenance
The following attestation bundles were made for purehtml_purescraps-0.1.3.tar.gz:
Publisher:
publish-python-package.yml on purescraps/purehtml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
purehtml_purescraps-0.1.3.tar.gz -
Subject digest:
0fad09103b57e228022e95721b74883fff258440bf5bb47d1fdf6796959065bc - Sigstore transparency entry: 154173511
- Sigstore integration time:
-
Permalink:
purescraps/purehtml@d16de513ba91c0b20e36c244594d0699bcdea07d -
Branch / Tag:
refs/heads/master - Owner: https://github.com/purescraps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-package.yml@d16de513ba91c0b20e36c244594d0699bcdea07d -
Trigger Event:
push
-
Statement type:
File details
Details for the file purehtml_purescraps-0.1.3-py3-none-any.whl.
File metadata
- Download URL: purehtml_purescraps-0.1.3-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0293a57639e62c38bcbf5415f42202c046a23d67965d615291d6d4e49aa4dff3
|
|
| MD5 |
f98de8fa33dbfb1bb533d6b95fa27c6c
|
|
| BLAKE2b-256 |
057b25fdc90274a40c7f85bc54bb636d7e403102869a16c852d998773a62a56b
|
Provenance
The following attestation bundles were made for purehtml_purescraps-0.1.3-py3-none-any.whl:
Publisher:
publish-python-package.yml on purescraps/purehtml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
purehtml_purescraps-0.1.3-py3-none-any.whl -
Subject digest:
0293a57639e62c38bcbf5415f42202c046a23d67965d615291d6d4e49aa4dff3 - Sigstore transparency entry: 154173513
- Sigstore integration time:
-
Permalink:
purescraps/purehtml@d16de513ba91c0b20e36c244594d0699bcdea07d -
Branch / Tag:
refs/heads/master - Owner: https://github.com/purescraps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-package.yml@d16de513ba91c0b20e36c244594d0699bcdea07d -
Trigger Event:
push
-
Statement type: