{"id":25323742,"url":"https://github.com/lightquantumarchive/opam-file-format-rs","last_synced_at":"2026-01-19T23:06:20.566Z","repository":{"id":37178360,"uuid":"308970334","full_name":"LightQuantumArchive/opam-file-format-rs","owner":"LightQuantumArchive","description":"Parser for the opam file syntax written in rust","archived":false,"fork":false,"pushed_at":"2022-06-17T01:41:30.000Z","size":70,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T14:02:34.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LightQuantumArchive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-31T20:55:37.000Z","updated_at":"2025-01-14T00:03:16.000Z","dependencies_parsed_at":"2022-06-24T04:21:41.122Z","dependency_job_id":null,"html_url":"https://github.com/LightQuantumArchive/opam-file-format-rs","commit_stats":null,"previous_names":["lightquantumarchive/opam-file-format-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Fopam-file-format-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Fopam-file-format-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Fopam-file-format-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Fopam-file-format-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LightQuantumArchive","download_url":"https://codeload.github.com/LightQuantumArchive/opam-file-format-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247744283,"owners_count":20988781,"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":"2025-02-14T00:17:09.523Z","updated_at":"2026-01-19T23:06:20.540Z","avatar_url":"https://github.com/LightQuantumArchive.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opam-file-format-rs\n\nParser for the opam file syntax written in rust.\n\n## Get Started\n\n### Binary\n\nFirst, let's run a benchmark and sanity check.\n\n``` shell script\n$ git clone https://github.com/ocaml/opam-repository\n$ find ./opam-repository -name \"opam\" \u003e opam-files\n$ opam-file-format-rs --benchmark ./opam-files\nreading files into memory...\nparsing files...\nparsed 15955 files. elapsed 0.36 secs. speed: 44691.88 files/sec\n```\n\nBy default, `opam-file-format-rs` outputs the AST of opam files.\n\n``` shell script\n$ opam-file-format-rs ./opam\nOpamAST {\n    items: {\n        \"opam-version\": Variable(\n            String(\n                \"2.0\",\n            ),\n        ),\n        ...\n    },\n}\n```\n\nTo make your life easier, you may ask `opam-file-format-rs` to output json format.\n\n``` shell script\n$ opam-file-format-rs ./opam --json | jq\n{\n  \"opam-version\": \"2.0\",\n  \"maintainer\": \"Thomas Gazagnaire \u003cthomas@gazagnaire.org\u003e\",\n  \"authors\": [\n    \"Thomas Gazagnaire \u003cthomas@gazagnaire.org\"\n  ],\n  ...\n  \"url\": {\n    \"src\": \"https://github.com/realworldocaml/craml/releases/download/1.0.0/craml-1.0.0.tbz\",\n    \"checksum\": \"md5=328d4d6bb137054894b215b3e10d95ca\"\n  }\n}\n```\n\nSyntax errors in files will be reported. Sometimes the error message or reported position may be useless, but anyway the parser will inform you what's going wrong.\n\n```\n$ opam-file-format-rs ./malformed-opam\nerror: expected `BOOL`, `ENVOP`, `IDENT`, `INT`, `LBRACE`, `LBRACKET`, `LOGOP`, `LPAR`, `PFXOP`, `RBRACE`, `RBRACKET`, `RELOP`, `RPAR`, `STRING`, or end of file\n --\u003e opam:5:13\n  | license:      \"ISC\"\n5 | boo: dev-repo: \"git+https://github.com/realworldocaml/craml.git\"\n  |              ^\n  | bug-reports:  \"https://github.com/realworldocaml/craml/issues\"\n```\n\n## Library\n\nThe document is WIP. You may take a peek at the bin crate to grasp a general idea how it works.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightquantumarchive%2Fopam-file-format-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightquantumarchive%2Fopam-file-format-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightquantumarchive%2Fopam-file-format-rs/lists"}