{"id":44131097,"url":"https://github.com/aibrush/pyparsing-rs","last_synced_at":"2026-02-14T03:01:22.531Z","repository":{"id":337242144,"uuid":"1152417381","full_name":"AiBrush/pyparsing-rs","owner":"AiBrush","description":"Rust rewrite of Python's pyparsing library with PyO3 bindings. 20-45x faster than original pyparsing.","archived":false,"fork":false,"pushed_at":"2026-02-10T17:11:18.000Z","size":310,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-13T09:26:25.061Z","etag":null,"topics":["fast","grammar","parser","rust","sparsing"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyparsing-rs/","language":"Rust","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/AiBrush.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-07T21:03:16.000Z","updated_at":"2026-02-10T17:03:03.000Z","dependencies_parsed_at":"2026-02-12T01:01:29.680Z","dependency_job_id":null,"html_url":"https://github.com/AiBrush/pyparsing-rs","commit_stats":null,"previous_names":["aibrush/pyparsing-rs"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/AiBrush/pyparsing-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiBrush%2Fpyparsing-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiBrush%2Fpyparsing-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiBrush%2Fpyparsing-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiBrush%2Fpyparsing-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AiBrush","download_url":"https://codeload.github.com/AiBrush/pyparsing-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiBrush%2Fpyparsing-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29433297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T02:20:56.896Z","status":"ssl_error","status_checked_at":"2026-02-14T02:11:29.478Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","grammar","parser","rust","sparsing"],"created_at":"2026-02-08T22:11:13.669Z","updated_at":"2026-02-14T03:01:22.475Z","avatar_url":"https://github.com/AiBrush.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyparsing-rs\n\n[![CI](https://github.com/aibrushcomputer/pyparsing-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/aibrushcomputer/pyparsing-rs/actions)\n\nRust rewrite of Python's `pyparsing` library with PyO3 bindings. **20-45x faster** than original pyparsing.\n\n## Installation\n\n```bash\npip install pyparsing-rs\n```\n\n## Usage\n\n```python\nimport pyparsing_rs as pp\n\n# Basic elements\nlit = pp.Literal(\"hello\")\nword = pp.Word(pp.alphas())\nregex = pp.Regex(r\"\\d+\")\n\n# Parse\nresult = lit.parse_string(\"hello world\")\nprint(result)  # ['hello']\n\n# Combinators\ncombined = pp.Literal(\"hello\") + pp.Literal(\" world\")\nresult = combined.parse_string(\"hello world\")\nprint(result)  # ['hello', ' world']\n\n# Repetition\nmany = pp.ZeroOrMore(pp.Literal(\"a\"))\nresult = many.parse_string(\"aaaa\")\nprint(result)  # ['a', 'a', 'a', 'a']\n```\n\n## Performance\n\n| Operation | pyparsing | pyparsing-rs | Speedup |\n|-----------|-----------|--------------|---------|\n| Literal | 4.13 µs | 0.22 µs | **18.5x** |\n| Word | 5.20 µs | 0.23 µs | **23.2x** |\n| Regex | 6.16 µs | 0.25 µs | **24.5x** |\n\n*Benchmarked on AMD Ryzen 9 5900X. Single parse_string() calls.*\n\n## Implemented Elements\n\n### Basic\n- `Literal` - Exact string match\n- `Keyword` - Match with word boundary\n- `Word` - Match word characters\n- `Regex` - Regular expression match\n\n### Combinators\n- `And` (+ operator) - Sequence match\n- `MatchFirst` (| operator) - First match wins\n- `Or` (^ operator) - Longest match wins\n\n### Repetition\n- `ZeroOrMore` (*) - 0 or more matches\n- `OneOrMore` (+) - 1 or more matches\n- `Optional` (?) - 0 or 1 matches\n\n### Structure\n- `Group` - Nest results\n- `Suppress` - Match but don't capture\n\n## Architecture\n\n- **Zero-copy parsing**: Uses `\u0026str` slices where possible\n- **Bitset character lookup**: O(1) character class matching\n- **Fast paths**: First-character optimization for literals\n- **PyO3 bindings**: Minimal overhead Python interop\n\n## Development\n\n```bash\n# Build\nmaturin develop --release\n\n# Test\npytest tests/ -v\n\n# Benchmark\npython tests/test_performance.py\n```\n\n## Project Structure\n\n```\npyparsing-rs/\n├── src/\n│   ├── core/          # Parser infrastructure\n│   │   ├── parser.rs  # ParserElement trait\n│   │   ├── context.rs # Parse position tracking\n│   │   ├── results.rs # ParseResults\n│   │   └── exceptions.rs\n│   ├── elements/      # Parser elements\n│   │   ├── literals.rs\n│   │   ├── chars.rs\n│   │   ├── combinators.rs\n│   │   ├── repetition.rs\n│   │   └── structure.rs\n│   └── lib.rs         # Python bindings\n├── tests/\n└── test_grammars/     # Benchmark grammars\n```\n\n## License\n\nMIT\n\n## Links\n\n- [PyPI](https://pypi.org/project/pyparsing-rs/)\n- [GitHub](https://github.com/aibrushcomputer/pyparsing-rs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faibrush%2Fpyparsing-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faibrush%2Fpyparsing-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faibrush%2Fpyparsing-rs/lists"}