{"id":16002774,"url":"https://github.com/soreing/parsley","last_synced_at":"2025-07-27T14:08:15.820Z","repository":{"id":143571399,"uuid":"615627287","full_name":"Soreing/parsley","owner":"Soreing","description":"Golang fast JSON unmarshaller with code generation","archived":false,"fork":false,"pushed_at":"2023-09-17T20:44:33.000Z","size":280,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T09:21:37.645Z","etag":null,"topics":["fast","generator","go","golang","json","unmarshaller"],"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/Soreing.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":"2023-03-18T07:39:40.000Z","updated_at":"2023-09-17T15:43:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"98ffbbd3-a3f6-475c-ab72-9142f78a10d7","html_url":"https://github.com/Soreing/parsley","commit_stats":null,"previous_names":["soreing/fastjson"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Soreing/parsley","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soreing%2Fparsley","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soreing%2Fparsley/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soreing%2Fparsley/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soreing%2Fparsley/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Soreing","download_url":"https://codeload.github.com/Soreing/parsley/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soreing%2Fparsley/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267368932,"owners_count":24076093,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"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":["fast","generator","go","golang","json","unmarshaller"],"created_at":"2024-10-08T10:03:49.370Z","updated_at":"2025-07-27T14:08:15.796Z","avatar_url":"https://github.com/Soreing.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parsley JSON\nParsley JSON is a JSON decoder that parses a JSON string into objects. Parsley JSON uses the definition of a struct to generate code that is efficient and fast. This library is inspired by [easyjson](https://github.com/mailru/easyjson).\n\n## Installation \n```\ngo install github.com/Soreing/parsley/parsley@latest\ngo get github.com/Soreing/parsley\n```\n\n## Usage\nObjects that implement the ParsleyJSON interfaces can be used in the Unmarshal functions to encode or decode data. The interface can be implemented with the generator (or custom written for rare use cases).\n```golang\ndat := []byte (`{\"name\": \"A Box\", \"weight\": 10.5}`)\nbox := Box{}\n\nerr := parsley.Unmarshal(dat, \u0026box)\nif err != nil {\n\tpanic(err)\n}\n```\n\n## Code Generation\nTo encode/decode data, first you need to generate the mapping functions for the structs you want to use. The json flag tells the generator to process the defined struct. You can add more flags separated by commas.\n```golang\n//parsley:json\ntype Box struct {\n\tName   string  `json:\"name\"`\n\tWeight float64 `json:\"weight\"`\n}\n\n//parsley:json\ntype BoxList []Box\n```\nRun the generator with the path to the file or folder to the module. Assuming the above file is in tests/models/box.go, use the following command:\n```\nparsley tests/models/box.go\n```\n### Struct Flags\n| Flag | Description |\n|------|-------------|\n| json   | Process the struct or type define in the generator |\n| skip   | Skip the struct or type define during generation |\n| public | Include private fields in encoding/decoding |\n\n### Command Line Arguments\n| Arg | Description |\n|------|-------------|\n| -all | Processes all structs in a file or directory |\n| -public | Include private fields in encoding/decoding for all types |\n| -output_filename | Sets the filename of the generated code |\n| -camel_case | Uses camel case naming for fields unless explicitly defined |\n| -lower_case | Uses lower case naming for fields unless explicitly defined |\n| -kebab_case | Uses kebab case naming for fields unless explicitly defined |\n| -snake_case | Uses snake case naming for fields unless explicitly defined |\n| -pascal_case | Uses pascal case naming for fields unless explicitly defined |\n\n## Todo List\n- Implement reading of scientific (exponential) notation for number fields\n- Improve speed of floating point number creation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoreing%2Fparsley","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoreing%2Fparsley","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoreing%2Fparsley/lists"}