{"id":20662392,"url":"https://github.com/evanzhoudev/donut-py","last_synced_at":"2025-08-21T06:38:43.834Z","repository":{"id":197484288,"uuid":"698738347","full_name":"EvanZhouDev/donut-py","owner":"EvanZhouDev","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-30T20:10:05.000Z","size":2,"stargazers_count":133,"open_issues_count":0,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T16:21:21.744Z","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/EvanZhouDev.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}},"created_at":"2023-09-30T20:09:30.000Z","updated_at":"2025-01-22T15:26:57.000Z","dependencies_parsed_at":"2023-10-02T04:00:56.338Z","dependency_job_id":null,"html_url":"https://github.com/EvanZhouDev/donut-py","commit_stats":null,"previous_names":["evanzhoudev/donut-py"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EvanZhouDev/donut-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanZhouDev%2Fdonut-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanZhouDev%2Fdonut-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanZhouDev%2Fdonut-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanZhouDev%2Fdonut-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvanZhouDev","download_url":"https://codeload.github.com/EvanZhouDev/donut-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanZhouDev%2Fdonut-py/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266263057,"owners_count":23901353,"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":[],"created_at":"2024-11-16T19:14:00.509Z","updated_at":"2025-07-21T08:01:47.895Z","avatar_url":"https://github.com/EvanZhouDev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🍩 donut.py\nThe first-ever `donut.c` Python clone that *looks like a donut*!\n\n```python\nwhile ('o_' in dir()) or (A := (0)\n               ) or (B := 0) or print((                           \n            \"\\x1b[2J\")) or not ((sin := ((                        \n         __import__('math'))).sin)) or not (                     \n      cos := __import__('math').cos) or (o_ := (                   \n     True)): [pr() for b in [[(func(), b) for ((z                 \n    )) in [[0 for _ in range(1760)]] for b in [[ (                \n   \"\\n\") if ii % 80 == 79 else \" \" for ii in range(               \n  1760)]] for o, D, N in [(o, D, N) for j in range((              \n 0), 628, 7) for i in range(0, 628, 2) for (c, d, e,(             \nf), g, l, m, n) in [(sin(     i / 100), cos(j / 100),(             \nsin(A)), sin(j / 100),          cos(A), cos(i / 100) ,            \ncos(B), sin(B))] for              (h) in [d + 2] for (            \nD, t) in [ (1 / ( c               * h * e + f * g + (5\n)), c * h * g - f *                e)] for (x, y) in [            \n(int( 40 + 30 * D * (              l * h * m - t * n)),            \nint( 12 + 15 * D * ( l           * h * n + t * (m))))]            \n for (o, N) in [(x + 80 *     y,int(8 * (( f * e -  c              \n  * d * g) * m - c * d * e - f * g - l * d * n)))] if             \n  0 \u003c x \u003c 80 and 22 \u003e y \u003e 0] if D \u003e z[o] for func in              \n   [lambda: (z.pop((o))), lambda: z.insert((o), (D)                \n    ),(lambda: (b.pop( o))), lambda: b.insert((o),                 \n     \".,-~:;=!*#$@\"[ N if N \u003e 0 else 0])]][ 0][1]                 \n       ] for pr in [lambda: print(\"\\x1b[H\"),                    \n         lambda: print(\"\".join(b))] if (A :=\n            A + 0.02) and ( B := B + 0.02)]                        \n               #..--~~EvanZhouDev:~~--.#                           \n                    #...,2023,...#\n```\n\nRun with:\n```\npython3 donut.py\n```\n\nOriginal `donut.c` idea from [Andy Sloane's blog](https://www.a1k0n.net/2011/07/20/donut-math.html).\nOriginal one-line `donut.py` implementation by [Julius Syvis's DonutPy](https://github.com/Julius-Syvis/DonutPy).\n\nIf the donut looks vertically stretched, then you may need to adjust your font to be a square font, or just modify line width and font spacing.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanzhoudev%2Fdonut-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanzhoudev%2Fdonut-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanzhoudev%2Fdonut-py/lists"}