{"id":13650927,"url":"https://github.com/italia/publiccode-parser-go","last_synced_at":"2025-10-26T02:31:15.738Z","repository":{"id":37549349,"uuid":"126201618","full_name":"italia/publiccode-parser-go","owner":"italia","description":"publiccode.yml parser library and validator in Go","archived":false,"fork":false,"pushed_at":"2025-02-08T08:21:51.000Z","size":9845,"stargazers_count":15,"open_issues_count":9,"forks_count":6,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-02-08T09:27:32.222Z","etag":null,"topics":["golang","golang-library","hacktoberfest","parser","publiccode","publiccodeyml","validator","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/italia.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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-21T15:38:11.000Z","updated_at":"2024-07-25T12:38:05.000Z","dependencies_parsed_at":"2024-03-29T09:29:13.471Z","dependency_job_id":"ce87324e-598a-4ea8-8dfe-e4df2ad7f47a","html_url":"https://github.com/italia/publiccode-parser-go","commit_stats":{"total_commits":299,"total_committers":16,"mean_commits":18.6875,"dds":0.5919732441471572,"last_synced_commit":"e31c524bd126b55e1c1d29212b30b31928f40584"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italia%2Fpubliccode-parser-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italia%2Fpubliccode-parser-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italia%2Fpubliccode-parser-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italia%2Fpubliccode-parser-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/italia","download_url":"https://codeload.github.com/italia/publiccode-parser-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238247984,"owners_count":19440879,"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":["golang","golang-library","hacktoberfest","parser","publiccode","publiccodeyml","validator","yaml"],"created_at":"2024-08-02T02:00:42.671Z","updated_at":"2025-10-26T02:31:15.733Z","avatar_url":"https://github.com/italia.png","language":"Go","funding_links":[],"categories":["💻 Publiccode"],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 --\u003e\n\u003c!-- MD033/no-inline-html --\u003e\n# publiccode.yml parser for Go\n\n[![Join the #publiccode channel](https://img.shields.io/badge/Slack%20channel-%23publiccode-blue.svg?logo=slack)](https://developersitalia.slack.com/messages/CAM3F785T)\n[![Get invited](https://slack.developers.italia.it/badge.svg)](https://slack.developers.italia.it/)\n\nA Go parser and validator for [publiccode.yml](https://github.com/publiccodeyml/publiccode.yml)\nfiles.\n\n`publiccode.yml` is an international standard for describing public software, which\nshould be placed at the root of Free/Libre and Open Source software repositories.\n\nThis parser performs syntactic and semantic validation according to the\n[official spec](https://yml.publiccode.tools).\n\n## Features\n\n- Go library and CLI tool (`publiccode-parser`)\n- Supports the latest version of the `publiccode.yml` Standard\n- `publiccode-parser` can output validation errors as JSON or in\n  [errorformat](https://vim-jp.org/vimdoc-en/quickfix.html#error-file-format)\n  friendly way\n- Verifies the existence of URLs by checking the response for URL fields\n  (can be disabled)\n\n## As a library\n\n```go\nparser, err := publiccode.NewDefaultParser()\n\n// error handling\n\npubliccode, err := parser.Parse(\"file:///path/to/local/dir/publiccode.yml\")\n// OR\n// parse.Parse(\"https://github.com/example/example/publiccode.yml\")\n```\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/italia/publiccode-parser-go/v5.svg)](https://pkg.go.dev/github.com/italia/publiccode-parser-go/v5)\n\n## From command line\n\nThe `publiccode-parser` binary can be used to validate a `publiccode.yml`\nfrom the command line.\n\nTo get the latest version use:\n\n```shell\ngo install github.com/italia/publiccode-parser-go/v5/publiccode-parser@latest\n```\n\nOr get a precompiled package from the [release page](https://github.com/italia/publiccode-parser-go/releases/latest)\n\nExample:\n\n```shell\n$ publiccode-parser mypubliccode.yml\npubliccode.yml:36:1: error: developmentStatus: developmentStatus must be one of the following: \"concept\", \"development\", \"beta\", \"stable\" or \"obsolete\"\npubliccode.yml:48:3: warning: legal.authorsFile: This key is DEPRECATED and will be removed in the future. It's safe to drop it\npubliccode.yml:12:5: warning: description.en.genericName: This key is DEPRECATED and will be removed in the future. It's safe to drop it\n```\n\nRun `publiccode-parser --help` for the available command line flags.\n\nThe tool returns 0 in case of successful validation, 1 otherwise.\n\n## With Docker\n\nYou can easily validate your files using Docker on your local machine or in your\nCI pipeline:\n\n```shell\ndocker run -i italia/publiccode-parser-go /dev/stdin \u003c publiccode.yml\n```\n\nThe image is available on [Dockerhub](https://hub.docker.com/repository/docker/italia/publiccode-parser-go).\nYou can also build your own running:\n\n```sh\ndocker build -t italia/publiccode-parser-go .\n```\n\n### Examples\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\nThe examples assume that your `publiccode.yml` file is on your local machine,\nat `/opt/publiccodes/publiccode.yml`\n\n- Validate and print the canonicalized file\n\n  ```shell\n  docker run -i italia/publiccode-parser-go -export /dev/stdout /dev/stdin \u003c publiccode.yml\n  ```\n\n- Validate a publiccode file named `publiccode.yml` in `/home/user`\n\n  ```shell\n  docker run -v /home/user:/go/src/files italia/publiccode-parser-go\n  ```\n\n- Validate a publiccode file named `/opt/publiccodes/my-amazing-code.yaml`\n\n  ```shell\n  docker run -v /opt/publiccodes:/go/src/files italia/publiccode-parser-go my-amazing-code.yaml\n  ```\n\n- Validate `publiccode.yml` without using the network (fe. checking URLs are reachable)\n\n  ```shell\n  docker run -v /opt/publiccodes/publiccodes:/files italia/publiccode-parser-go -no-network publiccode.yml\n  ```\n\n- Debugging, access the container interactive shell, overriding the entrypoint\n\n  ```shell\n  docker run -it --entrypoint /bin/sh italia/publiccode-parser-go\n  ```\n\n\u003c/details\u003e\n\n## Contributing\n\nContributing is always appreciated.\nFeel free to open issues, fork or submit a Pull Request.\nIf you want to know more about how to add new fields, check out the\n[publiccode.yml project](https://github.com/publiccodeyml/publiccode.yml)\nand its [CONTRIBUTING.md](https://github.com/publiccodeyml/publiccode.yml/blob/main/CONTRIBUTING.md)\nguidelines.\n\n## See also\n\n- [publiccode-parser-php](https://github.com/bfabio/publiccode-parser-php) - PHP\n  bindings for this library\n- [publiccode-crawler](https://github.com/italia/publiccode-crawler) - a Go\n  crawler that uses this library\n\n## Maintainers\n\nThis software is maintained by community contributors.\n\n## License\n\n© 2018-present Team per la Trasformazione Digitale - Presidenza del Consiglio\ndei Ministri\n\nLicensed under the EUPL 1.2.\nThe version control system provides attribution for specific lines of code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitalia%2Fpubliccode-parser-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitalia%2Fpubliccode-parser-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitalia%2Fpubliccode-parser-go/lists"}