Writer for HTTP Archive (HAR) files
Project description
harfile
This package provides zero dependency writer for building HAR (HTTP Archive) files in Python.
NOTES:
- The writer assumes single-threaded
- Pages are not supported
Usage
import datetime
import io
import harfile
# Write to a file
with harfile.open("filename.har") as har:
har.add_entry(
startedDateTime=datetime.datetime.now(datetime.timezone.utc),
time=42,
request=harfile.Request(
method="GET",
url="http://example.com",
httpVersion="HTTP/1.1",
),
response=harfile.Response(
status=200,
status_text="OK",
httpVersion="HTTP/1.1",
),
)
# Write to a string buffer
buffer = io.StringIO()
with harfile.open(buffer) as har:
pass
License
The code in this project is licensed under MIT license.
By contributing to harfile
, you agree that your contributions will be licensed under its MIT license.
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
harfile-0.2.0.tar.gz
(9.9 kB
view hashes)