{"id":28277660,"url":"https://github.com/dmigwi/go-piparser","last_synced_at":"2026-05-07T08:35:12.108Z","repository":{"id":57487519,"uuid":"172299827","full_name":"dmigwi/go-piparser","owner":"dmigwi","description":"Golang implementation of  the Politeia's proposals votes data parser tool.","archived":false,"fork":false,"pushed_at":"2019-12-19T17:18:29.000Z","size":175,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-18T16:47:14.741Z","etag":null,"topics":["decred","git","github","golang","parser-tool","politeia"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmigwi.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}},"created_at":"2019-02-24T05:27:14.000Z","updated_at":"2019-12-19T17:18:32.000Z","dependencies_parsed_at":"2022-09-01T22:52:04.795Z","dependency_job_id":null,"html_url":"https://github.com/dmigwi/go-piparser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dmigwi/go-piparser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmigwi%2Fgo-piparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmigwi%2Fgo-piparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmigwi%2Fgo-piparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmigwi%2Fgo-piparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmigwi","download_url":"https://codeload.github.com/dmigwi/go-piparser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmigwi%2Fgo-piparser/sbom","scorecard":{"id":347832,"data":{"date":"2025-08-11","repo":{"name":"github.com/dmigwi/go-piparser","commit":"ae8cbf4067e11a1eea44ac0a1ae1f53b9ac02db4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T07:33:43.515Z","repository_id":57487519,"created_at":"2025-08-18T07:33:43.515Z","updated_at":"2025-08-18T07:33:43.515Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32729676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["decred","git","github","golang","parser-tool","politeia"],"created_at":"2025-05-21T07:13:04.263Z","updated_at":"2026-05-07T08:35:12.103Z","avatar_url":"https://github.com/dmigwi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-piparser\n[![Build Status](https://travis-ci.org/dmigwi/go-piparser.svg?branch=master)](https://travis-ci.org/dmigwi/go-piparser)\n[![ISC License](https://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)\n![GitHub top language](https://img.shields.io/github/languages/top/dmigwi/go-piparser.svg?color=green\u0026style=popout)\n\ngo-piparser is tool that parses [Politeia](https://proposals.decred.org) proposals votes data stored in github.\nIt adds a timestamp field obtained from the commit history. The tool makes use of the git commandline interface to clone \nand query the politeia votes data. Github repository updates are fetched at intervals of 1hr after setting up the\nenvironment. [politeia doc](https://docs.decred.org/advanced/navigating-politeia-data/#voting-and-comment-data)\n\nCheck out the full doc at [godoc.org](https://godoc.org/github.com/dmigwi/go-piparser/proposals) or code navigation on [sourcegraph.com](https://sourcegraph.com/github.com/dmigwi/go-piparser/-/blob/proposals/parser.go)\n\n\n## Table of Contents\n\n- [Requirement](#requirement)\n- [Installation](#installation)\n- [Import go-piparser](#import-go-piparser)\n- [Initialize the Parser instance](#initialize-the-parser-instance)\n- [Fetch the Proposal's Votes](#fetch-the-proposal's-votes)\n- [Fetch new updates via a trigger channel](#fetch-new-updates-via-a-trigger-channel)\n- [Full Sample Program](#full-sample-program)\n- [Test Client](#test-client)\n\n\n## Requirement\n\n- git -  The tool requires a functional git commandline installation.\nTo install git visit [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n\n    - A git version of `v1.5.1` released on [April 4th 2007](https://github.com/git/git/releases/tag/v1.5.1) or one after is needed.\n\n- go - Golang installation is needed.\n    - go1.11 or one after is required.\n\n## Installation\n\n```bash\n    go get -u github.com/dmigwi/go-piparser/proposals\n```\n\n## Import go-piparser\n\n```go\n    import \"github.com/dmigwi/go-piparser/proposals\"\n```\n\n## Initialize the Parser instance\n\n```go\n    repoOwner := \"\"\n    repoName  := \"\"\n    cloneDir  := \"/path/to/root/clone/directory\"\n\n    parser, err := proposals.NewParser(repoOwner, repoName, cloneDir)\n    if err != nil {\n\t\tlog.Fatalf(\"unexpected error occured: %v\", err)\n    }\n```\n\n- `repoOwner` - defines the owner of the repository where the Politeia votes are to be queries from. If not set, it defaults to `decred-proposals`\n- `repoName` - defines the name of the repository holding the Politeia votes. If not set, it defaults to `mainnet`.\n- `cloneDir` - defines the directory where the said repository will be cloned into. If not set, a tmp folder is created and set.\n\n## Fetch the Proposal's Votes\n\n```go\n    // Decred Integration for IDAX Exchange Proposal token. \n    // https://proposals.decred.org/proposals/60adb9c0946482492889e85e9bce05c309665b3438dd85cb1a837df31fbf57fb\n    proposalToken := \"60adb9c0946482492889e85e9bce05c309665b3438dd85cb1a837df31fbf57fb\"\n\n    // ProposalHistory returns votes data only associated with the set proposal token. \n    data, err := parser.ProposalHistory(proposalToken)\n\tif err != nil {\n\t\tlog.Fatalf(\"unexpected error occured: %v\", err)\n    }\n    \n    ...\n```\n\n## Fetch new updates via a signal channel\n- The one hour interval at which the update signal is sent starts to count immediately\nafter the `proposals.NewParser(repoOwner, repoName, cloneDir)` is invoked.\n\n```go\n    // Updates trigger signal is sent hourly after which retrieval of the newly\n    // fetched updates can commence.\n    proposalUpdatesSignal := parser.UpdateSignal()\n    for range  proposalUpdatesSignal{\n        // set the since time value\n        since, err := time.Parse(time.RFC3339,\"2019-03-05T00:59:18Z\")\n        if err != nil {\n            log.Fatalf(\"unexpected error occured: %v\", err)\n        }\n\n        // Fetch the proposal updates since 2019-03-05T00:59:18Z.\n        data, err = parser.ProposalHistorySince(proposalToken, since)\n        if err != nil {\n            log.Fatalf(\"unexpected error occured: %v\", err)\n        }\n    }\n```\n\n## Full Sample Program\n\n```go \n    package main\n\n    import (\n        \"log\"\n\n        \"github.com/dmigwi/go-piparser/proposals\"\n    )\n\n    func main() {\n        cloneDir := \"/path/to/root/clone/directory\"\n\n         // Set the Proposal token\n        proposalToken := \"60adb9c0946482492889e85e9bce05c309665b3438dd85cb1a837df31fbf57fb\"\n\n        // Create a new Parser instance\n        parser, err := proposals.NewParser(\"\", \"\", cloneDir)\n        if err != nil {\n            log.Fatalf(\"unexpected error occured: %v\", err)\n        }\n\n        // Retrieve the proposal token's votes data.\n        data, err := parser.ProposalHistory(proposalToken)\n        if err != nil {\n            log.Fatalf(\"unexpected error occured: %v\", err)\n        }\n\n        ...\n\n        // Retrieve proposal updates after they happen.\n        proposalUpdatesSignal := parser.UpdateSignal()\n        for range  proposalUpdatesSignal{\n            // set the since time value\n            since, err := time.Parse(time.RFC3339,\"2019-03-05T00:59:18Z\")\n            if err != nil {\n                log.Fatalf(\"unexpected error occured: %v\", err)\n            }\n\n            // Fetch the proposal updates since 2019-03-05T00:59:18Z.\n            data, err = parser.ProposalHistorySince(proposalToken, since)\n            if err != nil {\n                log.Fatalf(\"unexpected error occured: %v\", err)\n            }\n\n            ...\n        }\n    }\n\n```\n\n## Test Client\n\nFind a complete test go-piparser implementation [here](https://github.com/dmigwi/go-piparser/tree/master/testutil)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmigwi%2Fgo-piparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmigwi%2Fgo-piparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmigwi%2Fgo-piparser/lists"}