{"id":13639069,"url":"https://github.com/msaelices/py2mojo","last_synced_at":"2025-09-05T21:42:01.513Z","repository":{"id":193553760,"uuid":"689011305","full_name":"msaelices/py2mojo","owner":"msaelices","description":"Automated Python to Mojo code translation","archived":false,"fork":false,"pushed_at":"2024-05-18T13:36:49.000Z","size":51,"stargazers_count":144,"open_issues_count":2,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-01T03:16:34.268Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msaelices.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-08T15:29:11.000Z","updated_at":"2025-08-18T14:03:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e9525d6-819a-4224-ba06-18090d7faa4c","html_url":"https://github.com/msaelices/py2mojo","commit_stats":null,"previous_names":["msaelices/py2mojo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/msaelices/py2mojo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaelices%2Fpy2mojo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaelices%2Fpy2mojo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaelices%2Fpy2mojo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaelices%2Fpy2mojo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msaelices","download_url":"https://codeload.github.com/msaelices/py2mojo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msaelices%2Fpy2mojo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273826739,"owners_count":25175234,"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-09-05T02:00:09.113Z","response_time":402,"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":"2024-08-02T01:00:57.336Z","updated_at":"2025-09-05T21:42:01.466Z","avatar_url":"https://github.com/msaelices.png","language":"Python","readme":"# py2mojo\n\nAutomated Python to Mojo code translation\n\nA tool to automatically convert Python code to the new [Mojo programming language](https://www.modular.com/mojo).\n\n## Installation\n\n```bash\npip install py2mojo\n```\n\n## Usage\n\nYou can read the usage by running `py2mojo --help`:\n\n```bash\n❯ py2mojo --help\nusage: py2mojo [-h] [--inplace] [--extension {mojo,🔥}] [--convert-def-to-fn | --no-convert-def-to-fn] [--convert-class-to-struct | --no-convert-class-to-struct] [--float-precision {32,64}]\n               filenames [filenames ...]\n\npositional arguments:\n  filenames\n\noptions:\n  -h, --help            show this help message and exit\n  --inplace             Rewrite the file inplace\n  --extension {mojo,🔥}  File extension of the generated files\n  --convert-def-to-fn, --no-convert-def-to-fn\n  --convert-class-to-struct, --no-convert-class-to-struct\n  --float-precision {32,64}\n```\n\nExamples:\n\n```bash\n❯ py2mojo myfile.py\n```\n\n```bash\n❯ py2mojo mypackage/*.py\n```\n\n## ⚠ Disclaimer\n\nPlease be aware that the Mojo programming language is still in its nascent stages of development. As with any young language, there might be frequent updates, changes, and unforeseen quirks in its syntax and behavior. There will probably be instances where the conversion might not work and may require manual adjustments.\n\nSo, consider this tool as experimental. Please do not trust the generated code and double-check it.\n\n## Implementation details\n\nThis uses a similar approach to the [pyupgrade](https://github.com/asottile/pyupgrade) tool, using the AST parser to analyze the Python code and replace some parts of it with the equivalent Mojo code.\n\nAs Mojo is a superset of Python, non-replaced logic should be also a valid Mojo code.\n\n## Contributing\n\n### How to install it locally\n\n1. Fork the repository\n\n2. Clone your fork:\n\n```bash\ngit clone git@github.com:youraccount/py2mojo.git\n```\n\n3. Install it locally:\n```\ncd py2mojo\npip install -e .\n```\n","funding_links":[],"categories":["Why is it called Mojo?","Translation","🛠️ Development Tools\u003ca id='development-tools'\u003e\u003c/a\u003e","Python"],"sub_categories":["Advent of Code 2023"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsaelices%2Fpy2mojo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsaelices%2Fpy2mojo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsaelices%2Fpy2mojo/lists"}