{"id":25070803,"url":"https://github.com/strvdr/bookgen","last_synced_at":"2025-07-31T09:10:33.887Z","repository":{"id":275376457,"uuid":"925905139","full_name":"strvdr/bookgen","owner":"strvdr","description":"Simple python script for converting PGN files to a usable opening book format that my engines can use.","archived":false,"fork":false,"pushed_at":"2025-02-02T03:13:54.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T16:47:48.376Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strvdr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-02T02:58:18.000Z","updated_at":"2025-02-02T03:13:57.000Z","dependencies_parsed_at":"2025-02-02T04:19:07.670Z","dependency_job_id":"3f44e550-bc48-42d9-a00a-29424b94f6d2","html_url":"https://github.com/strvdr/bookgen","commit_stats":null,"previous_names":["strvdr/bookgen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/strvdr/bookgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvdr%2Fbookgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvdr%2Fbookgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvdr%2Fbookgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvdr%2Fbookgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strvdr","download_url":"https://codeload.github.com/strvdr/bookgen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvdr%2Fbookgen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268016960,"owners_count":24181657,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-02-06T21:36:15.097Z","updated_at":"2025-07-31T09:10:33.848Z","avatar_url":"https://github.com/strvdr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bookgen\n\nThis is a simple python script that allows you to convert PGN files to ones that are usable for opening books. The output of the script is a binary file that contains information in the following format:\n\n```\nhash: u64,        // 8 bytes\nsource: u8,       // 1 byte\ntarget: u8,       // 1 byte\npromotion: u8,    // 1 byte\nmoveType: u8,     // 1 byte\npiece: u8,        // 1 byte\nweight: u16,      // 2 bytes\nlearn: u16,       // 2 bytes\n```\n\nBecause Zig automatically pads packed structs to be in 8-byte segments, our Python script also does the same thing. 7 additional padding bits are added to the end of each book entry.\n\n### Usage\n\nThe paths are hard coded in the main function, you can edit them to fit your needs.\n```\ngit clone git@github.com:strvdr/bookgen.git\ncd bookgen\nvenv venv\nsource ./bin/venv/activate\npython3 -m pip install -r requirements.txt\npython3 pgn_to_book.py\n```\n \nIf you need an example of how to make this work with your engine, you can view the implementation in the (Syzygy.zig file of Kirin Chess)[https://github.com/strvdr/kirin-chess].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrvdr%2Fbookgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrvdr%2Fbookgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrvdr%2Fbookgen/lists"}