{"id":22632196,"url":"https://github.com/sammi-turner/python-to-mojo","last_synced_at":"2026-02-07T08:03:20.583Z","repository":{"id":197318054,"uuid":"698437021","full_name":"sammi-turner/Python-To-Mojo","owner":"sammi-turner","description":"Python code snippets with their Mojo equivalents.","archived":false,"fork":false,"pushed_at":"2024-11-17T22:03:30.000Z","size":285,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-19T20:42:26.922Z","etag":null,"topics":["mojo","mojolang","python3"],"latest_commit_sha":null,"homepage":"","language":"Mojo","has_issues":true,"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/sammi-turner.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-29T23:30:55.000Z","updated_at":"2024-11-17T22:03:33.000Z","dependencies_parsed_at":"2023-10-16T08:54:22.141Z","dependency_job_id":"924c9f7b-dae8-479c-857b-1422556de53f","html_url":"https://github.com/sammi-turner/Python-To-Mojo","commit_stats":null,"previous_names":["sammi-turner/mojo-examples","sammi-turner/mojo-python-code-compared","sammi-turner/python-to-mojo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sammi-turner/Python-To-Mojo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammi-turner%2FPython-To-Mojo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammi-turner%2FPython-To-Mojo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammi-turner%2FPython-To-Mojo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammi-turner%2FPython-To-Mojo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammi-turner","download_url":"https://codeload.github.com/sammi-turner/Python-To-Mojo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammi-turner%2FPython-To-Mojo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29189675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"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":["mojo","mojolang","python3"],"created_at":"2024-12-09T02:16:47.174Z","updated_at":"2026-02-07T08:03:20.565Z","avatar_url":"https://github.com/sammi-turner.png","language":"Mojo","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr\u003e\n\n# Python To Mojo\n\nPython code snippets with their Mojo equivalents.\n\n\u003cbr\u003e\n\n## Mojo Playground\n\nA Mojo programming environment is available from the Mojo product [page](https://www.modular.com/mojo).\n\n\u003cbr\u003e\n\n## Local installation\n\nAt the time of writing, Mojo is available for Ubuntu-based linux distros, MacOS (M1 and M2) and WSL2 on Windows.\n\n\u003cbr\u003e\n\n## Environment variables\n\nThese are at the end of my .bashrc file on Ubuntu.\n\n```sh\nexport MODULAR_HOME=\"/home/user/.modular\"\nexport PATH=\"/home/user/.modular/pkg/packages.modular.com_mojo/bin:$PATH\"\nexport MOJO_PYTHON_LIBRARY=\"/usr/lib/x86_64-linux-gnu/libpython3.10.so\"\n```\n\nThese are at the end of my .zshrc file on my M2 Mac.\n\n```sh\nexport MODULAR_HOME=\"/Users/sammiturner/.modular\"\nexport PATH=\"/Users/sammiturner/.modular/pkg/packages.modular.com_mojo/bin:$PATH\"\nexport MOJO_PYTHON_LIBRARY=\"/opt/homebrew/bin/python3\"\n```\n\n\u003cbr\u003e\n\n## Editor recommendation\n\nDue to the Mojo ecosystem being in its infancy right now, I recommend using VSCode as your editor, with the [Error Lens and Mojo extensions installed](https://youtu.be/KYEAiTBbNT8?si=_jTQnoe3cj3ViLYB).\n\n\u003cbr\u003e\n\n## Shell aliases\n\nTo save time building and running my Mojo code, I have added some aliases to my .bashrc file.\n\n```sh\n# MOJO ALIASES\nalias mbr='mojo build app.mojo \u0026\u0026 ./app'\nalias mba='mojo build app.mojo'\nalias mra='./app'\n```\n\n\u003cbr\u003e\n\n## AI Code Generation\n\nLarge Language Models (LLMs) are only effective for me because I don't trust their output.\n\nI always test the code that they generate!\n\nHowever, given that Python3 is a mature language that is fairly popular in academia and industry, there is a suprising amount of training data for them to work with.\n\nOnce you have generated the code that you want in Python3, manually making the changes required to turn it into valid Mojo code is not so hard.\n\n\u003cbr\u003e\n\n## Learning Python with LLMs\n\nThis prompt template is good for learning Python idioms.\n\n```\nWhat is the idiomatic way to [do the thing you want to do]\nin Python3?\n```\n\n\u003cbr\u003e\n\n## Function Generation With LLMs\n\nThis prompt template is good for generating Python functions.\n\n```\nWrite a [name] function in Python3 that takes\n[name the parameters and their types] and returns\na [type] such that [describe what the function does].\nThen show me the code.\n```\n\n\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammi-turner%2Fpython-to-mojo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammi-turner%2Fpython-to-mojo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammi-turner%2Fpython-to-mojo/lists"}