{"id":28531155,"url":"https://github.com/pikulev/hario-core","last_synced_at":"2025-07-07T12:31:30.393Z","repository":{"id":297879236,"uuid":"998013921","full_name":"pikulev/hario-core","owner":"pikulev","description":"Type-safe Python HAR model: Pydantic-powered parsing, validation, normalization, and transformation—readying HTTP Archive data for analytics and easy extension.","archived":false,"fork":false,"pushed_at":"2025-06-08T04:22:37.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-08T04:38:22.070Z","etag":null,"topics":["developer-tools","http-archive","http-archive-format","parser","pydantic","python","web-debug","web-performance"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pikulev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-07T17:24:11.000Z","updated_at":"2025-06-08T04:28:45.000Z","dependencies_parsed_at":"2025-06-08T04:52:46.289Z","dependency_job_id":null,"html_url":"https://github.com/pikulev/hario-core","commit_stats":null,"previous_names":["pikulev/hario-core"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pikulev/hario-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikulev%2Fhario-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikulev%2Fhario-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikulev%2Fhario-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikulev%2Fhario-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pikulev","download_url":"https://codeload.github.com/pikulev/hario-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikulev%2Fhario-core/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264077294,"owners_count":23553825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-tools","http-archive","http-archive-format","parser","pydantic","python","web-debug","web-performance"],"created_at":"2025-06-09T15:09:34.517Z","updated_at":"2025-07-07T12:31:30.387Z","avatar_url":"https://github.com/pikulev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hario Core — Type-safe HAR Model \u0026 Transform\n\n[![PyPI version](https://badge.fury.io/py/hario-core.svg?cachebust=1)](https://badge.fury.io/py/hario-core)\n[![Build Status](https://github.com/pikulev/hario-core/actions/workflows/python-package.yml/badge.svg)](https://github.com/pikulev/hario-core/actions/workflows/python-package.yml)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![codecov](https://codecov.io/gh/pikulev/hario-core/graph/badge.svg?token=BUJG4K634B)](https://codecov.io/gh/pikulev/hario-core)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/pikulev/hario-core)\n\nA modern, extensible, and type-safe Python library for parsing, transforming, and analyzing HAR (HTTP Archive) files. Built on Pydantic, Hario-Core provides robust validation, flexible transformation, and easy extension for custom HAR formats.\n\n## Features\n\n- **Type-Safe Parsing**: Validates HAR files using Pydantic models, catching errors early.\n- **Transformers**: Apply built-in or custom transformations to each HAR entry (e.g., flatten, normalizations).\n- **Normalization**: Ensures all numeric fields (sizes, timings) are non-negative, so you can safely sum, aggregate, and analyze data without errors from negative values. This is crucial for analytics and reporting.\n- **Deterministic \u0026 Random IDs**: Generate unique or deterministic IDs for each entry. Deterministic IDs ensure that the same request always gets the same ID—useful for deduplication, comparison, and building analytics pipelines.\n- **Extensible**: Register your own entry models to support browser-specific or proprietary HAR extensions (e.g., Chrome DevTools, Safari).\n- **Composable Pipelines**: Chain any number of transformers and ID strategies for flexible data processing.\n\n## Installation\n\n```bash\npip install hario-core\n```\n\n## Quickstart\n\n### 1. Parse and validate a HAR file\n\n```python\nfrom hario_core.parse import parse\n\nhar_log = parse(\"example.har\")\nentries = har_log.model_dump()[\"entries\"]  # list of dicts\n```\n\n### 2. Transform entries with a pipeline\n\n```python\nfrom hario_core.transform import Pipeline, flatten, set_id, by_field\n\npipeline = Pipeline([\n    set_id(by_field([\"request.url\", \"startedDateTime\"]))\n])\nresults = pipeline.process(entries)\n```\n\n### 3. Custom entry models (extensions)\n\n```python\nfrom hario_core.parse import register_entry_model\nfrom hario_core.models import Entry\n\ndef is_custom_entry(entry: dict) -\u003e bool:\n    return \"x-custom\" in entry\n\nclass CustomEntry(Entry):\n    x_custom: str\n\nregister_entry_model(is_custom_entry, CustomEntry)\n```\n\n## Public API\n\n### Parsing and validation\n- `parse(path_or_bytes_or_filelike) -\u003e HarLog`\n- `validate(har_dict: dict) -\u003e HarLog`\n- `register_entry_model(detector: Callable, model: Type[Entry])`\n- `entry_selector(entry_dict: dict) -\u003e Type[Entry]`\n\n### Models\n- `Entry`, `HarLog`, `DevToolsEntry` (and all standard HAR 1.2 models)\n\n### Transform\n- `Pipeline`, `flatten`, `normalize_sizes`, `normalize_timings`, `set_id`, `by_field`, `uuid`, `json_array_handler`\n\n## Documentation\n\n- [API Reference](https://github.com/pikulev/hario-core/blob/main/docs/api.md)\n- [Changelog](https://github.com/pikulev/hario-core/blob/main/docs/changelog.md)\n- [Contributing](https://github.com/pikulev/hario-core/blob/main/CONTRIBUTING.md)\n\n\n## License\n\nMIT License. See [LICENSE](https://github.com/pikulev/hario-core/blob/main/LICENSE).\n\n## Supported Python Versions\n\n- Python 3.10+ ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpikulev%2Fhario-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpikulev%2Fhario-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpikulev%2Fhario-core/lists"}