Skip to main content

harfile

CI Coverage Version Python versions License

This package provides a zero-dependency writer for building HAR (HTTP Archive) files in Python.

NOTES:

  • The writer assumes a single-threaded environment.
  • 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,
            statusText="OK",
            httpVersion="HTTP/1.1",
        ),
        timings=harfile.Timings(
            send=0,
            wait=0,
            receive=0,
        ),
    )


# 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.

Metadata

Release files for harfile 0.6.0

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

Source distribution (sdist)

Source distribution for harfile 0.6.0
File Size Uploaded Provenance Actions
harfile-0.6.0.tar.gz 10.8 kB With provenance Details for harfile-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for harfile 0.6.0
File Interpreter ABI Platform Actions
harfile-0.6.0-py3-none-any.whl Python 3 none any Details for harfile-0.6.0-py3-none-any.whl

Total release size: 18.2 kB

Release files / harfile-0.6.0.tar.gz

Download URL harfile-0.6.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3e5751d52c59bda35789748256cbac097b664e65315d15ded67b006c173e34b3
BLAKE2b-256 checksum
How to use checksums
4203d0c14a45c41820731e537ae92586d1aebe1a333a3347cef4f69a467c2d90
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 Oct 21, 2026.

Transparency log

Release files / harfile-0.6.0-py3-none-any.whl

Download URL harfile-0.6.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f2209d6ec164a2aea7e8fb2b49d9fef5ddeee51b65dbfd28a4167185c34bb30
BLAKE2b-256 checksum
How to use checksums
fab53f96a2782a5a83ca6d4d48438fa5d70a69c5086d9479311b01d1fa7b686c
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 Oct 21, 2026.

Transparency log

Security for harfile 0.6.0

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for harfile-0.6.0.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 Oct 21, 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