{"id":31658197,"url":"https://github.com/biru-codeastromer/py2cpp","last_synced_at":"2026-04-11T07:03:35.111Z","repository":{"id":309621715,"uuid":"1036968824","full_name":"biru-codeastromer/py2cpp","owner":"biru-codeastromer","description":"Python → C++ converter for competitive programming. React + FastAPI + Ollama (Qwen). Side-by-side run, compile-repair loop, CF boilerplate.","archived":false,"fork":false,"pushed_at":"2025-08-12T22:54:24.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-12T23:32:19.000Z","etag":null,"topics":["ai-codegen","cloudflare-tunnel","codeforces","competitive-programming","fastapi","ollama","python-to-cpp","qwen","react","vitejs"],"latest_commit_sha":null,"homepage":"https://py2cpp.vercel.app/","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/biru-codeastromer.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,"zenodo":null}},"created_at":"2025-08-12T21:26:09.000Z","updated_at":"2025-08-12T22:54:28.000Z","dependencies_parsed_at":"2025-08-12T23:42:33.284Z","dependency_job_id":null,"html_url":"https://github.com/biru-codeastromer/py2cpp","commit_stats":null,"previous_names":["biru-codeastromer/py2cpp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/biru-codeastromer/py2cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biru-codeastromer%2Fpy2cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biru-codeastromer%2Fpy2cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biru-codeastromer%2Fpy2cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biru-codeastromer%2Fpy2cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biru-codeastromer","download_url":"https://codeload.github.com/biru-codeastromer/py2cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biru-codeastromer%2Fpy2cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278795602,"owners_count":26047240,"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-10-07T02:00:06.786Z","response_time":59,"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":["ai-codegen","cloudflare-tunnel","codeforces","competitive-programming","fastapi","ollama","python-to-cpp","qwen","react","vitejs"],"created_at":"2025-10-07T15:14:31.312Z","updated_at":"2025-10-07T15:14:32.732Z","avatar_url":"https://github.com/biru-codeastromer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py2cpp — AI Python → C++ (CF-ready)\n\n[![Vercel](https://img.shields.io/badge/Frontend-Vercel-black?logo=vercel)](https://py2cpp.vercel.app/)\n![FastAPI](https://img.shields.io/badge/Backend-FastAPI-009485?logo=fastapi)\n![Ollama](https://img.shields.io/badge/LLM-Ollama-000?logo=ollama)\n![Model](https://img.shields.io/badge/Qwen2.5--Coder-7B-blue)\n![License](https://img.shields.io/badge/License-MIT-informational)\n\n**py2cpp** converts Python to C++17 with a Codeforces-style boilerplate, then compiles and runs both versions side-by-side on the same input.  \nAI-first: Qwen2.5-Coder (via Ollama) + a compile-and-repair loop.  \n**Live UI:** https://py2cpp.vercel.app/\n\n---\n\n## Requirements\n- macOS with Homebrew\n- Python 3.10+, Node 18+\n- Ollama installed\n\n---\n\n## Quick start\n\n1) **Model server**\n```bash\nbrew install ollama cloudflare/cloudflare/cloudflared\nollama serve\nollama pull qwen2.5-coder:7b\n```\n\n2) **Backend**\n```bash\ncd backend\npython3 -m venv .venv \u0026\u0026 source .venv/bin/activate\npip install -r requirements.txt\nexport OLLAMA_MODEL=qwen2.5-coder:7b\nuvicorn main:app --host 0.0.0.0 --port 8000\n```\n\n3) **Frontend**\n```bash\ncd frontend\necho \"VITE_API_URL=https://\u003cyour-tunnel\u003e.trycloudflare.com\" \u003e .env\nnpm install \u0026\u0026 npm run dev\n```\n\u003e The frontend is static. The backend (FastAPI + Ollama + g++) runs on your machine and must stay running.\n\n4) **Public URL**\n```bash\ncloudflared tunnel --url http://localhost:8000\n# copy the https://\u003crandom\u003e.trycloudflare.com URL\n```\n\n### Notes:  Deployment can be only for frontend via netlify or vercel ; backend would be running locally constantly to work\n\n## API\n\n- POST /ai/convert → body { \"py\": \"\u003cpython\u003e\" } → { \"cpp\": \"\u003cfull c++ file\u003e\" }\n\n- POST /run/python → { \"code\": \"\u003cpython\u003e\", \"stdin\": \"\u003cinput\u003e\" }\n\n- POST /run/cpp → { \"code\": \"\u003cc++\u003e\", \"stdin\": \"\u003cinput\u003e\" }\n\n- GET /healthz → { \"ok\": true }\n\n\n### Key points:\n\n- macOS/Clang is handled by a fallback header set when \u003cbits/stdc++.h\u003e is unavailable.\n\n- Targeted at contest-style Python; highly dynamic features may require manual edits.\n\n### License\nMIT © Birajit Saikia\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiru-codeastromer%2Fpy2cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiru-codeastromer%2Fpy2cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiru-codeastromer%2Fpy2cpp/lists"}