{"id":32286901,"url":"https://github.com/zajrik/gura-dart-parser","last_synced_at":"2026-02-22T01:37:08.540Z","repository":{"id":61973580,"uuid":"382714668","full_name":"zajrik/gura-dart-parser","owner":"zajrik","description":"A Gura parser implementation for Dart","archived":false,"fork":false,"pushed_at":"2021-08-02T01:02:40.000Z","size":165,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-02T04:03:57.466Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dart","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/zajrik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-07-03T21:47:53.000Z","updated_at":"2024-04-03T16:28:31.000Z","dependencies_parsed_at":"2022-10-24T13:30:49.318Z","dependency_job_id":null,"html_url":"https://github.com/zajrik/gura-dart-parser","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/zajrik/gura-dart-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zajrik%2Fgura-dart-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zajrik%2Fgura-dart-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zajrik%2Fgura-dart-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zajrik%2Fgura-dart-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zajrik","download_url":"https://codeload.github.com/zajrik/gura-dart-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zajrik%2Fgura-dart-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29703227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"ssl_error","status_checked_at":"2026-02-21T23:35:03.832Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2025-10-23T02:01:42.976Z","updated_at":"2026-02-22T01:37:08.534Z","avatar_url":"https://github.com/zajrik.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gura Dart parser\n\n[![Pub Version](https://img.shields.io/pub/v/gura)](https://pub.dev/packages/gura)\n![GitHub top language](https://img.shields.io/github/languages/top/zajrik/gura-dart-parser)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/zajrik/gura-dart-parser/test?label=tests)](https://github.com/zajrik/gura-dart-parser/actions/workflows/test.yml)\n[![GitHub issues](https://img.shields.io/github/issues/zajrik/gura-dart-parser)](https://github.com/zajrik/gura-dart-parser/issues)\n[![documentation](https://img.shields.io/badge/documentation-gura-4cc61e.svg)](https://pub.dev/documentation/gura/latest/)\n[![Discord](https://img.shields.io/discord/861318432879149068)](https://discord.gg/JcMhpXdvBn)\n\nThis repository contains the implementation of a [Gura configuration format](https://gura.netlify.app/)\nparser for Dart, written in pure Dart. (Compliant with spec version 1.0.0).\n\n## Installation\n```\ndart pub add gura\n```\n\n## Usage\nImport `package:gura/gura.dart` and use the [parse()], [parseFile()], or [parseFileSync()]\nfunctions to convert your Gura input into a `Map\u003cString, dynamic\u003e` for use in your code.\n\n### Examples\n```dart\nimport 'package:gura/gura.dart';\n\nfinal String guraString = '''\n# This is a Gura document.\ntitle: \"Gura Example\"\n\nan_object:\n    username: \"Stephen\"\n    pass: \"Hawking\"\n\n# Line breaks are ok when inside arrays\nhosts: [\n    \"alpha\",\n    \"omega\"\n]\n''';\n\nvoid main()\n{\n    // parse: transforms a Gura string into a Map of Gura key/value pairs\n    final Map\u003cString, dynamic\u003e parsedGura = parse(guraString);\n    print(parsedGura);\n\n    // Access a specific field\n    print('Title -\u003e ${parsedGura['title']}');\n\n    // Iterate over structures (parsedGura['hosts'] is List\u003cdynamic\u003e but we know\n    // it contains strings so we can safely cast to String when iterating over it)\n    for (final String host in parsedGura['hosts'])\n        print('Host -\u003e $host');\n\n    // dump: stringifies Map\u003cString, dynamic\u003e as a Gura-compatible string\n    print(dump(parsedGura));\n}\n```\n\n```dart\nimport 'dart:io';\nimport 'package:gura/gura.dart';\n\nFuture\u003cvoid\u003e main() async\n{\n    final File guraFile = File('foo_bar.ura');\n    final Map\u003cString, dynamic\u003e parsedGura = await parseFile(guraFile);\n    ...\n}\n```\n\n```dart\nimport 'dart:io';\nimport 'package:gura/gura.dart';\n\nvoid main()\n{\n    final File guraFile = File('foo_bar.ura');\n    final Map\u003cString, dynamic\u003e parsedGura = parseFileSync(guraFile);\n    ...\n}\n```\n\nIn the event that any of the library function names (`parse`, `parseFile`, etc.)\nconflict with functions from another library, alias gura and use qualified function\ncalls via the alias:\n\n```dart\nimport 'dart:io';\nimport 'package:gura/gura.dart' as gura;\n\nvoid main()\n{\n    final File guraFile = File('foo_bar.ura');\n    final Map\u003cString, dynamic\u003e parsedGura = await gura.parseFile(guraFile);\n    ...\n}\n```\n\n## Contributing\n1. Fork this project\n2. Create new branch for your feature\n3. Commit and push your changes\n4. Submit a pull request\n\nSadly, Dart's selection of tools for maintaining a consistent code style do not\nallow for much customization in a way that supports my personal code style, and\nI don't like the opinionated style of `dartfmt`, so if you choose to contribute,\nplease do your best to maintain code style consistent with the rest of the repo\nin your contributions. I'll review PRs to ensure this.\n\n### Tests\nTo run all tests, run `dart test` in the project root.\n\n## Credits\nCredit for the vast majority of code and logic in this project goes to the original\nauthors of the [TS/JS Gura parser](https://github.com/gura-conf/gura-js-parser).\n\nThis parser started as a 1:1 port of the TypeScript/JavaScript parser implementation,\nbut I've since done a lot of cleanup, restructuring, some logic refactoring, and\nI've redocumented everything, all to help me better solidify my understanding of the\ninner-workings of the original implementation.\n\nThere are also a lot of TypeScript/JavaScript mechanics that simply didn't translate\nwell to Dart so keeping the implementation port 1:1 was never going to work out,\nthough I didn't know quite how frequently I would encounter that problem until I\nstarted the project.\n\n## License\nThis repository is distributed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzajrik%2Fgura-dart-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzajrik%2Fgura-dart-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzajrik%2Fgura-dart-parser/lists"}