{"id":13413805,"url":"https://github.com/o1egl/fwencoder","last_synced_at":"2026-04-02T02:44:14.308Z","repository":{"id":53777660,"uuid":"115337993","full_name":"o1egl/fwencoder","owner":"o1egl","description":"Fixed width file parser (encoder/decoder) in GO (golang)","archived":false,"fork":false,"pushed_at":"2025-02-11T17:19:37.000Z","size":39,"stargazers_count":27,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T12:13:11.732Z","etag":null,"topics":["decoder","encoder","fixed-size-file","go","golang","library","parser","table","text"],"latest_commit_sha":null,"homepage":"","language":"Go","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/o1egl.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}},"created_at":"2017-12-25T12:55:29.000Z","updated_at":"2025-02-11T17:19:41.000Z","dependencies_parsed_at":"2024-06-18T21:20:03.459Z","dependency_job_id":"ee653e01-7925-4a32-a254-9cb31f63fd30","html_url":"https://github.com/o1egl/fwencoder","commit_stats":null,"previous_names":["o1egl/fwparser"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o1egl%2Ffwencoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o1egl%2Ffwencoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o1egl%2Ffwencoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o1egl%2Ffwencoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/o1egl","download_url":"https://codeload.github.com/o1egl/fwencoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244177648,"owners_count":20410993,"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":["decoder","encoder","fixed-size-file","go","golang","library","parser","table","text"],"created_at":"2024-07-30T20:01:49.792Z","updated_at":"2026-04-02T02:44:14.272Z","avatar_url":"https://github.com/o1egl.png","language":"Go","readme":"# Fixed width file parser (encoder/decoder) for GO (golang)\n[![License](http://img.shields.io/:license-mit-blue.svg)](LICENSE)\n[![GoDoc](https://godoc.org/github.com/o1egl/fwencoder?status.svg)](https://godoc.org/github.com/o1egl/fwencoder)\n![Build Status](https://github.com/o1egl/fwencoder/actions/workflows/build.yml/badge.svg?branch=master)\n[![codecov](https://codecov.io/gh/o1egl/fwencoder/branch/master/graph/badge.svg?token=BPBYoYAeZ0)](https://codecov.io/gh/o1egl/fwencoder)\n[![Go Report Card](https://goreportcard.com/badge/github.com/o1egl/fwencoder)](https://goreportcard.com/report/github.com/o1egl/fwencoder)\n\nThis library is using to parse fixed-width table data like:\n\n```\nName            Address               Postcode Phone          Credit Limit Birthday\nEvan Whitehouse V4560 Camel Back Road 3122     (918) 605-5383    1000000.5 19870101\nChuck Norris    P.O. Box 872          77868    (713) 868-6003     10909300 19651203\n```\n\n## Install\n\nTo install the library use the following command:\n\n```\n$ go get -u github.com/o1egl/fwencoder\n```\n\n## Decoding example\n\nParsing data from io.Reader:\n\n```go\ntype Person struct {\n\tName        string\n\tAddress     string\n\tPostcode    int\n\tPhone       string\n\tCreditLimit float64   `json:\"Credit Limit\"`\n\tBday        time.Time `column:\"Birthday\" format:\"20060102\"`\n}\n\nf, _ := os.Open(\"/path/to/file\")\ndefer f.Close()\n\nvar people []Person\nerr := fwencoder.UnmarshalReader(f, \u0026people)\n```\n\nYou can also parse data from byte array:\n\n```go\nb, _ := ioutil.ReadFile(\"/path/to/file\")\nvar people []Person\nerr := fwencoder.Unmarshal(b, \u0026people)\n```\n\n\n## Encoding example\n\n```go\npeople := []Person{\n\tName: \"John\",\n\tAddress: \"P.O. Box 872\",\n\tPhone: \"(713) 868-6003\", \n\tCreditLimit: 10909300,\n\tBday: \"19651203\"\n}\n\nb, err := fwencoder.Marshal(\u0026people)\nfmt.Println(string(b))\n```\n\nor you can directly write to io.Writer\n\n```go\npeople := []Person{\n\tName: \"John\",\n\tAddress: \"P.O. Box 872\",\n\tPhone: \"(713) 868-6003\", \n\tCreditLimit: 10909300,\n\tBday: \"19651203\"\n}\n\nerr := fwencoder.MarshalWriter(os.Stdout, \u0026people)\n```\n","funding_links":[],"categories":["序列化","Serialization","安全领域相关库","Relational Databases"],"sub_categories":["查询语","HTTP Clients","Advanced Console UIs","HTTP客户端","交流"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo1egl%2Ffwencoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo1egl%2Ffwencoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo1egl%2Ffwencoder/lists"}