harfile


Nameharfile JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryWriter for HTTP Archive (HAR) files
upload_time2024-06-29 18:28:34
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords har http testing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # harfile

[![CI](https://github.com/schemathesis/harfile/actions/workflows/ci.yml/badge.svg)](https://github.com/schemathesis/harfile/actions/workflows/ci.yml)
[![Coverage](https://codecov.io/gh/schemathesis/harfile/branch/main/graph/badge.svg)](https://codecov.io/gh/schemathesis/harfile/branch/main)
[![Version](https://img.shields.io/pypi/v/harfile.svg)](https://pypi.org/project/harfile/)
[![Python versions](https://img.shields.io/pypi/pyversions/harfile.svg)](https://pypi.org/project/harfile/)
[![License](https://img.shields.io/pypi/l/harfile.svg)](https://opensource.org/licenses/MIT)

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

```python
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](https://opensource.org/licenses/MIT).
By contributing to `harfile`, you agree that your contributions will be licensed under its MIT license.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "harfile",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Dmitry Dygalo <dmitry@dygalo.dev>",
    "keywords": "har, http, testing",
    "author": null,
    "author_email": "Dmitry Dygalo <dmitry@dygalo.dev>",
    "download_url": "https://files.pythonhosted.org/packages/6d/0f/fc074af5572e3faeadce77c9bc82d7bd3bacd522ffae8f76599ecf1af8e3/harfile-0.3.0.tar.gz",
    "platform": null,
    "description": "# harfile\n\n[![CI](https://github.com/schemathesis/harfile/actions/workflows/ci.yml/badge.svg)](https://github.com/schemathesis/harfile/actions/workflows/ci.yml)\n[![Coverage](https://codecov.io/gh/schemathesis/harfile/branch/main/graph/badge.svg)](https://codecov.io/gh/schemathesis/harfile/branch/main)\n[![Version](https://img.shields.io/pypi/v/harfile.svg)](https://pypi.org/project/harfile/)\n[![Python versions](https://img.shields.io/pypi/pyversions/harfile.svg)](https://pypi.org/project/harfile/)\n[![License](https://img.shields.io/pypi/l/harfile.svg)](https://opensource.org/licenses/MIT)\n\nThis package provides zero dependency writer for building HAR (HTTP Archive) files in Python.\n\n**NOTES**: \n\n- The writer assumes single-threaded\n- Pages are not supported\n\n## Usage\n\n```python\nimport datetime\nimport io\n\nimport harfile\n\n\n# Write to a file\nwith harfile.open(\"filename.har\") as har:\n    har.add_entry(\n        startedDateTime=datetime.datetime.now(datetime.timezone.utc),\n        time=42,\n        request=harfile.Request(\n            method=\"GET\",\n            url=\"http://example.com\",\n            httpVersion=\"HTTP/1.1\",\n        ),\n        response=harfile.Response(\n            status=200,\n            status_text=\"OK\",\n            httpVersion=\"HTTP/1.1\",\n        ),\n    )\n\n\n# Write to a string buffer\nbuffer = io.StringIO()\nwith harfile.open(buffer) as har:\n    pass\n\n```\n\n## License\n\nThe code in this project is licensed under [MIT license](https://opensource.org/licenses/MIT).\nBy contributing to `harfile`, you agree that your contributions will be licensed under its MIT license.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Writer for HTTP Archive (HAR) files",
    "version": "0.3.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/schemathesis/harfile",
        "Changelog": "https://github.com/schemathesis/harfile/blob/main/CHANGELOG.md",
        "Funding": "https://github.com/sponsors/Stranger6667",
        "Source Code": "https://github.com/schemathesis/harfile"
    },
    "split_keywords": [
        "har",
        " http",
        " testing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e66f46a3ca422a2580ee53e74ca4f19c7777a5d1108d6e0d82b37d8b0b427fdf",
                "md5": "42ae08552514460ff1496e873064bc87",
                "sha256": "ac11177e06c88c9553c8c73c16ab20428a176d1d2ebe00b41ce527ff0bdc47e6"
            },
            "downloads": -1,
            "filename": "harfile-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "42ae08552514460ff1496e873064bc87",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6824,
            "upload_time": "2024-06-29T18:28:33",
            "upload_time_iso_8601": "2024-06-29T18:28:33.041650Z",
            "url": "https://files.pythonhosted.org/packages/e6/6f/46a3ca422a2580ee53e74ca4f19c7777a5d1108d6e0d82b37d8b0b427fdf/harfile-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6d0ffc074af5572e3faeadce77c9bc82d7bd3bacd522ffae8f76599ecf1af8e3",
                "md5": "2d1504fe3f858327c61ef11925ce492c",
                "sha256": "23be8037e1296bb4787a15543a37835ed91f408c8296988f9ba022a44accad9e"
            },
            "downloads": -1,
            "filename": "harfile-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2d1504fe3f858327c61ef11925ce492c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 9949,
            "upload_time": "2024-06-29T18:28:34",
            "upload_time_iso_8601": "2024-06-29T18:28:34.480459Z",
            "url": "https://files.pythonhosted.org/packages/6d/0f/fc074af5572e3faeadce77c9bc82d7bd3bacd522ffae8f76599ecf1af8e3/harfile-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-29 18:28:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "schemathesis",
    "github_project": "harfile",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "harfile"
}
        
Elapsed time: 0.28861s