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
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
Metadata
Release files for purehtml-fatihky 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| purehtml_fatihky-0.1.1.tar.gz | 13.8 kB | Without provenance | Details for purehtml_fatihky-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| purehtml_fatihky-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for purehtml_fatihky-0.1.1-py3-none-any.whl |
Total release size: 37.6 kB
Release files / purehtml_fatihky-0.1.1.tar.gz
| Download URL | purehtml_fatihky-0.1.1.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66122638028c06a0a650ee009bf4c52344652d3127979e6cba15888661c3b385
|
|
BLAKE2b-256 checksum How to use checksums |
2bb071629eefe0cfcf1d053c308d8af682d623ee0d117d68def9d515a8304e09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Release files / purehtml_fatihky-0.1.1-py3-none-any.whl
| Download URL | purehtml_fatihky-0.1.1-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
224e2c9050dfe646ac91efe3e93c9de7153a74ef68932d3edc2ea5b2f401841f
|
|
BLAKE2b-256 checksum How to use checksums |
3e729f5a8655516462676f57b8f4bb7e7dfaec0167cb1f123f7455493ef863b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Security for purehtml-fatihky 0.1.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.