{"id":34018034,"url":"https://github.com/true-grue/peco","last_synced_at":"2025-12-13T14:54:24.937Z","repository":{"id":225122835,"uuid":"765121480","full_name":"true-grue/peco","owner":"true-grue","description":"Tiny parser combinators library written in Python.","archived":false,"fork":false,"pushed_at":"2025-05-20T21:39:35.000Z","size":42,"stargazers_count":15,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-25T21:05:28.530Z","etag":null,"topics":["minmalist","parser-combinators","peg","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/true-grue.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}},"created_at":"2024-02-29T10:20:20.000Z","updated_at":"2025-05-20T21:44:39.000Z","dependencies_parsed_at":"2024-02-29T12:52:18.309Z","dependency_job_id":null,"html_url":"https://github.com/true-grue/peco","commit_stats":null,"previous_names":["true-grue/peco"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/true-grue/peco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-grue%2Fpeco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-grue%2Fpeco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-grue%2Fpeco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-grue%2Fpeco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/true-grue","download_url":"https://codeload.github.com/true-grue/peco/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-grue%2Fpeco/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27707532,"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-12-13T02:00:09.769Z","response_time":147,"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":["minmalist","parser-combinators","peg","python"],"created_at":"2025-12-13T14:54:24.238Z","updated_at":"2025-12-13T14:54:24.931Z","avatar_url":"https://github.com/true-grue.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# peco\n\nThis is a tiny (100 LOC) parser combinator library in Python.\n\nInstallation:\n\n```\npip install pecolib\n```\n\nMain features:\n\n* Combined lexical and syntactic parsing using the PEG formalism.\n* Lexical rules with regular expressions (see `eat`).\n* Stack-based implementation of semantic actions (see `push` and `to`).\n* Selective memoization for performance (see `memo`).\n* Support for left recursion (see `left`).\n\nParsers are built from combinators and operate on a `Peco` namedtuple:\n\n* `text: str`. Source text.\n* `pos: int`. Position in the `text`.\n* `ok: bool`. Parsing result.\n* `stack: tuple | None`. Semantic result stack.\n* `glob: dict`. Global data, including the error position field (`err`).\n\nMost combinators follow PEG constructs:\n\n* `empty`. Empty string.\n* `seq`. Sequence.\n* `alt`. Ordered choice.\n* `many`. Zero-or-more.\n* `some`. One-or-more.\n* `opt`. Optional.\n* `peek`. And-predicate.\n* `npeek`. Not-predicate.\n\nSupport for semantic actions:\n\n* `push(f)`. Pushes a text fragment parsed by the `f` combinator onto the `stack`.\n* `to(f)`.  Pops `n` elements from the `stack` and passes them as arguments to function `f` with arity `n`. The result is pushed back onto the `stack`.\n* `group(f)`. Combines all elements pushed onto the `stack` by `f` into a single tuple.\n\nFor examples of using peco's combinators, see the tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrue-grue%2Fpeco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrue-grue%2Fpeco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrue-grue%2Fpeco/lists"}