{"id":16092346,"url":"https://github.com/alecthomas/expr","last_synced_at":"2025-03-18T06:30:58.964Z","repository":{"id":20100656,"uuid":"23370185","full_name":"alecthomas/expr","owner":"alecthomas","description":"Runtime evaluation of Go-like expressions","archived":false,"fork":false,"pushed_at":"2023-12-02T17:47:41.000Z","size":5,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T07:51:10.740Z","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":"angular/quickstart","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alecthomas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2014-08-26T23:28:15.000Z","updated_at":"2018-06-11T05:57:23.000Z","dependencies_parsed_at":"2024-10-27T17:23:51.836Z","dependency_job_id":"4b744fe3-f327-4a59-9820-09a06ea4f486","html_url":"https://github.com/alecthomas/expr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fexpr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fexpr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fexpr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Fexpr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alecthomas","download_url":"https://codeload.github.com/alecthomas/expr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243909945,"owners_count":20367536,"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-10-09T16:07:13.831Z","updated_at":"2025-03-18T06:30:58.486Z","avatar_url":"https://github.com/alecthomas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Runtime evaluation of Go-like expressions\n\n# What?\n\neg.\n\n```go\ne := expr.MustCompile(\"a + 1 \u003e 2\")\ne.Bool(expr.V{\"a\": 0}) == false\ne.Bool(expr.V{\"a\": 1}) == false\ne.Bool(expr.V{\"a\": 2}) == true\n```\n\nand\n\n```go\ne = expr.MustCompile(\"(a + 2) * 10\")\nn, err := e.Eval(expr.V{\"a\": 1})\nn.(int64) == 30\n```\n\nIt *does not* support:\n\n- Function calls (though this would be useful).\n- Slices or arrays.\n\nIt *does* support:\n\n- Truthiness evaluation, ala Python: eg. given `V{\"a\": 1}`, evaluating `a` will be true.\n- Automatic type coercion. eg. `\"a\" + 10` == `\"a10\"`\n- Nested fields. eg. `A.B == 2`\n\n# Why?\n\nIf you want to add simple expression-based filtering or numeric evaluation,\nthis might fit your needs.\n\n# Where?\n\n## Install\n\n```sh\n$ go get github.com/alecthomas/expr\n```\n\n## Docs\n\nYou can find the API documentation on [godoc](http://godoc.org/github.com/alecthomas/expr).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecthomas%2Fexpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecthomas%2Fexpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecthomas%2Fexpr/lists"}