{"id":20228299,"url":"https://github.com/matryer/str","last_synced_at":"2026-01-05T20:07:39.308Z","repository":{"id":57501434,"uuid":"41541704","full_name":"matryer/str","owner":"matryer","description":"String parsing package for Go. Converts strings to best guess value type.","archived":false,"fork":false,"pushed_at":"2015-12-31T09:31:06.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T15:11:14.914Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/matryer.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}},"created_at":"2015-08-28T10:33:31.000Z","updated_at":"2025-02-28T03:02:13.000Z","dependencies_parsed_at":"2022-08-28T16:51:46.272Z","dependency_job_id":null,"html_url":"https://github.com/matryer/str","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matryer%2Fstr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matryer%2Fstr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matryer%2Fstr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matryer%2Fstr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matryer","download_url":"https://codeload.github.com/matryer/str/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252851016,"owners_count":21814062,"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":[],"created_at":"2024-11-14T07:29:27.931Z","updated_at":"2026-01-05T20:07:34.289Z","avatar_url":"https://github.com/matryer.png","language":"Go","readme":"# str [![GoDoc](https://godoc.org/github.com/matryer/str?status.svg)](https://godoc.org/github.com/matryer/str)\nString parsing package for Go. Converts strings to best guess value type.\n\nSupported types (in this order):\n\n  * `nil` or `null`\n  * `bool`\n  * `int`\n  * `int64`\n  * `uint`\n  * `uint64`\n  * `float64`\n\nQuoted values are always strings with the quotes stripped.\n\nFor examples see the [test code](https://github.com/matryer/str/blob/master/str_test.go#L11-L115).\n\n## Get started\n\n```\ngo get gopkg.in/matryer/str.v1\n```\n\n## Usage\n\nThe simplest usage:\n\n```\nval := str.Parse(\"123\")\n```\n\nTo add additional `ParseFunc` functions:\n\n```\nparser := append(str.DefaultParser, toMyRangeType)\nval := parser.Parse(\"[1,3]\")\n```\n\nTo use your own parsers entirely, use `New`:\n\n```\nparser := str.New(toMyRangeType)\nval := parser.Parse(\"[1,3]\")\n```\n\n### Time\n\nTo add parsers for time, import the `parsers` package and use the `Time` method:\n\n```\nparser := append(str.DefaultParser, parsers.Time(time.RFC822))\nval := parser.Parse(\"02 Jan 06 15:04 MST\")\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatryer%2Fstr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatryer%2Fstr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatryer%2Fstr/lists"}