{"id":15297375,"url":"https://github.com/wklchris/python-sgfutil","last_synced_at":"2025-10-06T09:31:20.623Z","repository":{"id":57466099,"uuid":"353220651","full_name":"wklchris/python-sgfutil","owner":"wklchris","description":"为棋类爱好者开发的一个 SGF 操作库。| An SGF utilization library for Go/chess game players.","archived":false,"fork":false,"pushed_at":"2021-04-23T06:05:16.000Z","size":453,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T02:04:10.901Z","etag":null,"topics":["chess-games","par","python3","sgf"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wklchris.png","metadata":{"files":{"readme":"ReadMe-auto.py","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":"2021-03-31T04:04:38.000Z","updated_at":"2022-09-15T17:53:46.000Z","dependencies_parsed_at":"2022-08-31T02:11:32.638Z","dependency_job_id":null,"html_url":"https://github.com/wklchris/python-sgfutil","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wklchris%2Fpython-sgfutil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wklchris%2Fpython-sgfutil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wklchris%2Fpython-sgfutil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wklchris%2Fpython-sgfutil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wklchris","download_url":"https://codeload.github.com/wklchris/python-sgfutil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235515428,"owners_count":19002481,"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":["chess-games","par","python3","sgf"],"created_at":"2024-09-30T19:16:58.886Z","updated_at":"2025-10-06T09:31:14.962Z","avatar_url":"https://github.com/wklchris.png","language":"Python","readme":"# Modified from: https://stackoverflow.com/questions/59078333\nimport code\nimport enum\nimport sys\nfrom io import StringIO\nimport pyperclip\nimport re\n\nwith open('demo.py', 'r', encoding='utf8') as f:\n    filestr = f.read()\nsplits = re.split(r'(\"\"\"[\\s\\S]*?\"\"\")', filestr)\ncmd_str = ''.join([f\"READMEAUTO={i}\" if s.startswith('\"\"\"') else s for i, s in enumerate(splits)])\n\nfile = StringIO(cmd_str)\ndef readfunc(prompt):\n    try:\n        line = next(file).rstrip()\n    except StopIteration:\n        raise EOFError\n    print(prompt, line, sep='')\n    return line\n\nstdout = sys.stdout\nsys.stdout = StringIO()\ncode.interact(readfunc=readfunc)\noutput = sys.stdout.getvalue()\nsys.stdout = stdout\n\n# Post-process: replace back Readme paragraphs\nfor i, s in enumerate(splits):\n    if s.startswith('\"\"\"'):\n        output = output.replace(f\"\u003e\u003e\u003e READMEAUTO={i}\", \"```\" + s.strip('\"') + \"```\")\noutput = output.strip(\"`\") + \"```\"\nprint(output)\npyperclip.copy(output)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwklchris%2Fpython-sgfutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwklchris%2Fpython-sgfutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwklchris%2Fpython-sgfutil/lists"}