{"id":34075239,"url":"https://github.com/lasuillard-s/pydantic-fixedwidth","last_synced_at":"2026-05-31T19:32:36.591Z","repository":{"id":278767447,"uuid":"935494924","full_name":"lasuillard-s/pydantic-fixedwidth","owner":"lasuillard-s","description":"Custom Pydantic models for serializing and deserializing fixed-width format data.","archived":false,"fork":false,"pushed_at":"2026-05-12T07:35:27.000Z","size":420,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-12T09:34:11.156Z","etag":null,"topics":["fixed-width","pydantic","python"],"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/lasuillard-s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-19T14:37:48.000Z","updated_at":"2026-05-12T07:34:13.000Z","dependencies_parsed_at":"2026-04-02T15:00:57.730Z","dependency_job_id":null,"html_url":"https://github.com/lasuillard-s/pydantic-fixedwidth","commit_stats":null,"previous_names":["lasuillard/pydantic-fixedwidth","lasuillard-s/pydantic-fixedwidth"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/lasuillard-s/pydantic-fixedwidth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasuillard-s%2Fpydantic-fixedwidth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasuillard-s%2Fpydantic-fixedwidth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasuillard-s%2Fpydantic-fixedwidth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasuillard-s%2Fpydantic-fixedwidth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lasuillard-s","download_url":"https://codeload.github.com/lasuillard-s/pydantic-fixedwidth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lasuillard-s%2Fpydantic-fixedwidth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33746507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["fixed-width","pydantic","python"],"created_at":"2025-12-14T09:08:33.706Z","updated_at":"2026-05-31T19:32:36.574Z","avatar_url":"https://github.com/lasuillard-s.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pydantic-fixedwidth\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/gh/lasuillard-s/pydantic-fixedwidth/graph/badge.svg?token=R5pQWB43DP)](https://codecov.io/gh/lasuillard-s/pydantic-fixedwidth)\n[![PyPI - Version](https://img.shields.io/pypi/v/pydantic-fixedwidth)](https://pypi.org/project/pydantic-fixedwidth/)\n\nCustom Pydantic models for serializing and deserializing fixed-width format data.\n\n\n## 🚀 Quick Start\n\nInstall this package with pip:\n\n```shell\n$ pip install pydantic-fixedwidth\n```\n\nUsage example:\n\n```python\nfrom datetime import datetime, timezone\n\nfrom pydantic_fixedwidth import Fixedwidth, Padding\nfrom pydantic_fixedwidth import OrderedField as Field\n\ntzinfo = timezone.utc\n\n\nclass SomeRequest(Fixedwidth):\n    string: str = Field(length=8)\n    hangul: str = Field(length=6)\n    number: int = Field(length=10, justify=\"right\", fill_char=b\"0\")\n\n    # Just an padding field\n    p_: str = Padding(length=10)\n\n    # This field will be ignored in ser/de\n    ignore: str = Field(length=10, default=\"IGNORE\", exclude=True)\n\n    ts: datetime = Field(\n        length=20,\n        to_str=lambda dt: dt.strftime(\"%Y%m%d%H%M%S%f\"),\n        from_str=lambda s: datetime.strptime(s, \"%Y%m%d%H%M%S%f\").replace(tzinfo=tzinfo),\n    )\n\n\n# Format model to bytes\nsome_request = SomeRequest(\n    string=\"\u003cDFG\u0026\",\n    hangul=\"한글\",\n    number=381,\n    ts=datetime(2024, 1, 23, 14, 11, 20, 124277, tzinfo=tzinfo),\n)\nb = some_request.format_bytes()\n\nassert len(b) == 54\nassert b == b\"\u003cDFG\u0026   \\xed\\x95\\x9c\\xea\\xb8\\x800000000381          20240123141120124277\"\n\n# Parse bytes into model\nparsed_request = SomeRequest.parse_bytes(b)\n\nassert parsed_request == some_request\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasuillard-s%2Fpydantic-fixedwidth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasuillard-s%2Fpydantic-fixedwidth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasuillard-s%2Fpydantic-fixedwidth/lists"}