A tool to extract json from pytest-html report
Project description
pgpro-pytest-html-json-extractor
A tool to extract json data from pytest-html report. Developed and maintained by Postgres Professional.
Key features
- Extractor supports pytest-html v4.0.2+
- Extractor produces JSON with unescaped HTML entities in log messages (for pytest-html v4.1.0+)
Installation
You can install the package directly from the repository (until it's published to PyPI):
pip install pgpro-pytest-html-json-extractor
Usage
After installation, the tool is available via the pgpro-pytest-html-json-extractor command.
Basic Examples
Extract JSON from a report:
pgpro-pytest-html-json-extractor report.html -o report.json
Command Line Arguments
| Argument | Shorthand | Required | Description | Default |
|---|---|---|---|---|
--version |
No | Show program's version number and exit | None | |
--out |
-o |
Yes | Name of the output JSON file | None |
--verbose |
-v |
No | Level of logging verbosity | 3 |
--no-check-json |
No | Do not validate json data after extraction | None | |
--unescape-logs |
No | HTML entity decoding mode for logs (auto, yes, no) |
auto |
|
--replace |
-r |
No | Replace output if it exists | None |
input |
Yes | Positional argument for HTML file | None |
Log Unescaping Modes (--unescape-logs)
The tool provides granular control over how HTML entities (like ", & or ") are handled within test logs:
-
auto (Default): Smart detection mode. Automatically decides whether to decode entities based on the detected pytest-html report version. It ensures that logs are restored to their original "human-readable" state while maintaining the safety of other report metadata.
-
yes: Forceful decoding. Every HTML entity in the log field will be converted back to its literal character. Use this if you are dealing with heavily encoded custom output.
-
no: Raw mode. Disables all decoding, leaving the log data exactly as it was stored in the HTML source (including "Russian Doll" double-encoding). Ideal for debugging report structure or forensic data analysis.
Contributing
- Fork the repository.
- Create your feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'feat: add some amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
© 2026 Postgres Professional
Project details
Release history Release notifications | RSS feed
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 pgpro_pytest_html_json_extractor-1.1.0.tar.gz.
File metadata
- Download URL: pgpro_pytest_html_json_extractor-1.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0db5e3ca173be3d76e5abd83d6b015967a1a4024fb8abc8390e840dfd8c3aad7
|
|
| MD5 |
79db14e79f420dbec549bab99c21b736
|
|
| BLAKE2b-256 |
ff57fd96b0e255790a89fdba16421595b6fd18477e6509b7780087414b11c095
|
Provenance
The following attestation bundles were made for pgpro_pytest_html_json_extractor-1.1.0.tar.gz:
Publisher:
python-publish.yml on postgrespro/pgpro-pytest-html-json-extractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pgpro_pytest_html_json_extractor-1.1.0.tar.gz -
Subject digest:
0db5e3ca173be3d76e5abd83d6b015967a1a4024fb8abc8390e840dfd8c3aad7 - Sigstore transparency entry: 1520420406
- Sigstore integration time:
-
Permalink:
postgrespro/pgpro-pytest-html-json-extractor@df2d081eb85032d084e581dc0a433164a03051be -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/postgrespro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@df2d081eb85032d084e581dc0a433164a03051be -
Trigger Event:
release
-
Statement type:
File details
Details for the file pgpro_pytest_html_json_extractor-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pgpro_pytest_html_json_extractor-1.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
552a05a11c6cee4849dc85148c28264540fa11ba8695a317bdb8a3b059429dd5
|
|
| MD5 |
7dc4056eab588218c422bc626aec1480
|
|
| BLAKE2b-256 |
6f09525d52635d17418b78bbc8483b670ac9efb0d94d4d37f3a34da315e54087
|
Provenance
The following attestation bundles were made for pgpro_pytest_html_json_extractor-1.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on postgrespro/pgpro-pytest-html-json-extractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pgpro_pytest_html_json_extractor-1.1.0-py3-none-any.whl -
Subject digest:
552a05a11c6cee4849dc85148c28264540fa11ba8695a317bdb8a3b059429dd5 - Sigstore transparency entry: 1520420414
- Sigstore integration time:
-
Permalink:
postgrespro/pgpro-pytest-html-json-extractor@df2d081eb85032d084e581dc0a433164a03051be -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/postgrespro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@df2d081eb85032d084e581dc0a433164a03051be -
Trigger Event:
release
-
Statement type: