{"id":37072304,"url":"https://github.com/newsdev/apfake","last_synced_at":"2026-01-14T08:29:17.392Z","repository":{"id":30743006,"uuid":"125869836","full_name":"newsdev/apfake","owner":"newsdev","description":"A command-line tool for generating AP API JSON files for testing elections applications.","archived":true,"fork":false,"pushed_at":"2022-07-05T21:06:38.000Z","size":13,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-30T02:21:01.683Z","etag":null,"topics":["elections"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/newsdev.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":"2018-03-19T14:22:01.000Z","updated_at":"2024-06-10T03:01:43.000Z","dependencies_parsed_at":"2022-07-28T03:49:15.169Z","dependency_job_id":null,"html_url":"https://github.com/newsdev/apfake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/newsdev/apfake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Fapfake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Fapfake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Fapfake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Fapfake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newsdev","download_url":"https://codeload.github.com/newsdev/apfake/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Fapfake/sbom","scorecard":{"id":682023,"data":{"date":"2024-07-22","repo":{"name":"github.com/newsdev/apfake","commit":"a6529f55126adee31bef3c3953a4784b3288b17e"},"scorecard":{"version":"v5.0.0-rc2-109-gea7e27ed","commit":"ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4"},"score":3.1,"checks":[{"name":"Code-Review","score":3,"reason":"Found 3/9 approved changesets -- score normalized to 3","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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#maintained"}},{"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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#cii-best-practices"}},{"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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#signed-releases"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#license"}},{"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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#dangerous-workflow"}},{"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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#token-permissions"}},{"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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#binary-artifacts"}},{"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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#packaging"}},{"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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#fuzzing"}},{"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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#branch-protection"}},{"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/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: node-runner/Dockerfile:1: pin your Docker image by updating python to python@sha256:b40b4e5c86136e5400e9347459a9366315ff129e07175fdde8e221147ec5d541","Warn: pipCommand not pinned by hash: node-runner/Dockerfile:2","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#pinned-dependencies"}}]},"last_synced_at":"2025-08-21T23:30:15.435Z","repository_id":30743006,"created_at":"2025-08-21T23:30:15.435Z","updated_at":"2025-08-21T23:30:15.435Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","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":["elections"],"created_at":"2026-01-14T08:29:16.376Z","updated_at":"2026-01-14T08:29:17.385Z","avatar_url":"https://github.com/newsdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APFAKE\n\n![screen shot 2018-03-19 at 10 21 06 am](https://user-images.githubusercontent.com/109988/37601020-67598cd4-2b5f-11e8-9bfc-be939317eb46.png)\n\nHave you ever thought \"I should record the AP API test that's coming in a half hour\" only to find out that it actually concluded a half hour AGO? I've done this several times. And if I've done it before, I have to assume others have done it as well.\n\nTaking the FINAL JSON state file of an AP API election test (e.g., what happens if you hit the test URL after a test has run but before it's zeroed out in the moments before a new test or a live election), `apfake` will generate a file of zeros and then `n` intermediate states between the zeros and the final file with a smoothly incrementing set of votes.\n\nIn short: If you give it the last file of a test, `apfake` will generate all the missing files for you.\n\n## CAVEATS\n* `apfake` does not call races.\n* `apfake` votes do not properly match actual election night spikes when ballots are counted.\n* `apfake` precincts reporting and precincts reporting percentages are probably wrong.\n* `apfake` does not work on zeros or initialization data. It needs the format `\u0026results=ru` from the AP API.\n\n## USAGE\n### Installing\n`apfake` is easiest to install straight from PyPi. It requires a Python 3 environment.\n```\npip install apfake\n```\n\n### Using\n```\napfake -f 2018-03-20-final.json -n 10 -d /tmp/foo/ -r 2018-03-20\n```\n\n`apfake` accepts four command-line options, two are required.\n\n* `-f, --final-results-path` **REQUIRED** The path to the final results JSON file.\n* `-n, --number` **REQUIRED** The number of files to generate.\n* `-r, --racedate` *OPTIONAL* The `YYYY-MM-DD` racedate of the election. If the file specified in `final-results-path` has a racedate in the filename, this will be used. Otherwise, `apfake` will raise a `ValueError`.\n* `-d, --data-directory` *OPTIONAL* A directory or set of directories to write the data to. `apfake` will create these directories if they do not exist, and will also create a directory named for the `racedate` to hold the output files. Defaults to `/tmp/`.\n\n## DEBUGGING WITCHERY\nThis is the shape that `apfake` expects your JSON to have. If you use the format `\u0026results=ru` it will probably work. If you use a different format, it might work, though YMMV.\n```\n\"\"\"\nresults.keys()\ndict_keys(['electionDate', 'timestamp', 'races', 'nextrequest'])\n\nresults['races'][0].keys()\ndict_keys(['test', 'raceID', 'raceType', 'raceTypeID', 'officeID', 'officeName', 'party', 'seatName', 'reportingUnits'])\n\nresult['races][0]['reportingUnits'][0].keys()\ndict_keys(['statePostal', 'stateName', 'level', 'lastUpdated', 'precinctsReporting', 'precinctsTotal', 'precinctsReportingPct', 'candidates'])\n\nresults['races'][0]['reportingUnits'][0]['candidates'][0].keys()\ndict_keys(['first', 'last', 'party', 'incumbent', 'candidateID', 'polID', 'ballotOrder', 'polNum', 'voteCount'])\n\"\"\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewsdev%2Fapfake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewsdev%2Fapfake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewsdev%2Fapfake/lists"}