{"id":13807099,"url":"https://github.com/ethanchewy/PythonBuddy","last_synced_at":"2025-05-14T00:30:47.768Z","repository":{"id":11109354,"uuid":"68387896","full_name":"ethanchewy/PythonBuddy","owner":"ethanchewy","description":"1st Online Python Editor With Live Syntax Checking and Execution","archived":false,"fork":false,"pushed_at":"2025-04-19T07:12:58.000Z","size":45680,"stargazers_count":282,"open_issues_count":12,"forks_count":82,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-19T14:22:20.480Z","etag":null,"topics":["editor","linter","live","mooc","online","python","syntax-checker","text-editor"],"latest_commit_sha":null,"homepage":"https://pythonbuddy.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethanchewy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"ethanchewy"}},"created_at":"2016-09-16T14:42:07.000Z","updated_at":"2025-04-19T07:12:27.000Z","dependencies_parsed_at":"2024-01-03T01:20:36.253Z","dependency_job_id":"2dfde07d-849c-4965-aca2-1ff89dfae3ff","html_url":"https://github.com/ethanchewy/PythonBuddy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanchewy%2FPythonBuddy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanchewy%2FPythonBuddy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanchewy%2FPythonBuddy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanchewy%2FPythonBuddy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethanchewy","download_url":"https://codeload.github.com/ethanchewy/PythonBuddy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254046214,"owners_count":22005556,"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":["editor","linter","live","mooc","online","python","syntax-checker","text-editor"],"created_at":"2024-08-04T01:01:20.813Z","updated_at":"2025-05-14T00:30:47.742Z","avatar_url":"https://github.com/ethanchewy.png","language":"Python","funding_links":["https://github.com/sponsors/ethanchewy"],"categories":["Projects","Python"],"sub_categories":["Open Source Projects"],"readme":"# \u003ca href=\"http://pythonbuddy.com\"\u003ePythonBuddy\u003c/a\u003e 🖊️ 🐍\n\u003cbr\u003e\nOnline Python 3 Programming with Live Pylint Syntax Checking!\n\u003cbr\u003e\n\n![](gifs/demo.gif)\n\n### Usage\n\n**GitHub Codespaces**\n\nThe quickest way to use PythonBuddy is to launch your own GitHub Codespace!\n\n1) From the GitHub repo, click the green \"Code\" button and select \"Codespaces\".\n2) Create a new Codespace or select a previous one you've already created.\n3) Navigate to the new tab created for your Codespace.\n4) In terminal, run `bash ./setup.sh`\n5) Click \"Open in Browser\" in the bottom right corner after the setup is complete.\n  * The website may take a while to load or error at first while GitHub sets up the preview environment. In this case, reload the website.\n6) Remember to **stop your workspace** after you're done using it.\n\n**Local Use**\n\nDue to Codespace's monthly limits, it's recommended to run PythonBuddy locally if used often.\n\n1) Fetch from repo:\n  ```\n  git clone https://github.com/ethanchewy/PythonBuddy.git\n  ```\n2) Change to PythonBuddy directory\n  ```\n  cd PythonBuddy\n  ```\n2) Create virtualenv based on your own system:\n  ```\n  python3 -m venv venv\n  ```\n3) Activate virtual environment:\n  ```\n  source venv/bin/activate\n  ```\n4) Enusre that your virtualenv uses Python 3.7.6 via this command:\n  ```\n  python --version\n  ```\n  If you don't use Python Python 3.7.6, some Python libraries that PythonBuddy relies on **may not work**. Please refer to this documentation for figuring out how to create a specific version of Python via virtualenv via this StackOverflow [post](https://stackoverflow.com/a/39713544).\n  \n5) Pipe requirements to venv folder:\n  ```\n  pip install -r requirements.txt\n  ```\n6) Change to the PythonBuddy application folder. You should now be in `PythonBuddy/PythonBuddy/`.\n  ```\n  cd PythonBuddy\n  ```\n7) Set FLASK_APP variable:\n  ```\n  export FLASK_APP=app.py\n  ```\n8) Run flask app:\n  ```\n  flask run\n  ```\n  Open your browser to [localhost:5000](http://localhost:5000) . Voila! 🎉\n### Current Features:\n\u003cbr\u003e\n\u003cli\u003eLive Syntax Checking\n  \u003cul\u003e\n    \u003cli\u003eUses Pylint as checker (only prints out errors and warnings)\u003c/li\u003e\n    \u003cli\u003eSyntax Highlighting\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/li\u003e\n\n![](gifs/demo2.gif)\n\n\u003cbr\u003e\n\u003cli\u003ePython Execution\n  \u003cul\u003e\n    \u003cli\u003ePython Complilation\u003c/li\u003e\n    \u003cli\u003eBasic Sandboxing\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/li\u003e\n\n![](gifs/demo3.gif)\n\n\u003cbr\u003e\n\u003cli\u003eLive Error Table with Additional Help Suggestions\u003c/li\u003e\n\n![](gifs/demo4.gif)\n\n\u003cbr\u003e\n\n### Secure (Sandboxed) Version using Docker\nPlease check out [PythonBuddySandboxed](https://github.com/ethanchewy/PythonBuddySandboxed) for a fully working web implementation which uses a dockerized version of PythonBuddy called [PythonBuddySandbox](https://github.com/christophetd/docker-python-sandbox).\n\nThis builds off of christophetd's [docker-python-sandbox](https://github.com/christophetd/docker-python-sandbox) and just modifies it so that it runs pylint in the background and processes the pylint messages on the client side.\n\nTo see how he implements it on the web side, please check out [https://github.com/christophetd/code-execution-api-demo](https://github.com/christophetd/code-execution-api-demo)\n\nThis is still in alpha stage so there might be some bugs. If you want to implement this please check the 4 links above since documentation is a WIP.\n\n\n### Customization Options\n\n1. Edit app.py to change any pylint options (like showing/hiding hints warnings)\n2. Security\n 1. To create a much more secure Python Environment, consider using my Docker + Node.js implementation: https://github.com/ethanchewy/PythonBuddy#secure-sandboxed-version-using-docker\n3. For versions that used Python 2 or to see older versions, check: https://github.com/ethanchewy/PythonBuddy/releases\n\n### Unit Tests\nTo run tests, run this at the root directory:\n```\npytest\n```\nFor coverage run the following command in the root directory:\n```\npytest --cov-report html --cov=PythonBuddy tests/\n```\n\n\n### Future Goals:\n- Make easily embeddable for MOOCs like edX and other education platform\n- Create an analytics system that models the student's python learning and tells them where they need improvement (many programming students learn by copying and pasting and don't actually understand the nuances of the Python language).\n- Stricter Python Sandboxing via Pypy's sandboxing solution\n- Lower CPU usage\n- Allow users to generate a link to a unique code snippet similar to JSBin\n- Unit tests for client side JS\n\n### FAQ:\nWhy did you make this? \u003cbr\u003e\nIn 2014, I was a Community TA at MIT edX 6.00.1x course where I helped teach over 1000 students. The year after I started researching under Prof. Eni Mustafaraj. She had a data set from that course and we saw a high attrition rate of students within the first 2 weeks. After digging through the curriculum and data, I realized that the students left because of difficulties setting up their Python environment and complex error messages that they couldn't solve when running their code (ex: some students had path issues).  \n\u003cbr\u003e\nSo, I created PythonBuddy to address this issue so that students wouldn't have to go through the frustrations of setting up a Python environment and running into seemingly \"random\" bugs. PythonBuddy allows users to jump right into Python programming with the support of live syntax checking \u0026 highlighting. Also, professors and teachers could easily set up a server and allow students to quickly test out their code with PythonBuddy online.\n\nHas anyone created anything like this before? \u003cbr\u003e\nThere has never been a live syntax checker for python online. Similar projects that are not \"live\" are http://pep8online.com/ and http://antares.sip.ucm.es/cesar/pylint/\n\nHow can I contribute? \u003cbr\u003e\nYou can 🌟 star my repo, fork my repo, submit a pull request, and/or open issues!\n\nWhere's the code for embedding it in MOOCs? \u003cbr\u003e\nI'm currently working on this over here (for edx specifically): https://github.com/ethanchewy/pybuddy2.0 . If you want to embed this project directly to your site, you would use an iframe:\n```\n\u003ciframe src=\"https://pythonbuddy.com\"\u003e\u003c/iframe\u003e\n```\n\nI want the code to actually compile and run in a certain way?\u003cbr\u003e\nTo run PythonBuddy securely, you can check out my implementation of PythonBuddy with Docker and Node.js: https://github.com/ethanchewy/PythonBuddy#secure-sandboxed-version-using-docker. Basically, it dockerizes each user session (similar to creating a virtual machine for each user) and destroys it if it uses too much memory or runs malicious code.\n\u003cbr\u003e\nIf you want to actually execute the python in a restricted fashion at my Restricted Python branch: https://github.com/ethanchewy/PythonBuddy/tree/restrictedpython.\n\nHow do I run my own server?\nRegular: https://github.com/ethanchewy/OnlinePythonLinterSyntaxChecker/wiki\n\u003cbr\u003e\nSandboxed: https://github.com/ethanchewy/PythonBuddy/wiki/Running-Sandboxed-PythonBuddy\n\n### Press:\nFeatured on \u003ca href=\"https://twitter.com/FlaskCon/status/1280753108818096128\"\u003eFlaskCon 2020\u003c/a\u003e, \u003ca href = \"https://twitter.com/PythonWeekly/status/839928984389451777\"\u003ePython Weekly\u003c/a\u003e, \u003ca href =\"https://twitter.com/cssauthor/status/841178825924976642\"\u003eCSS Author\u003c/a\u003e, and the \u003ca href =\"https://twitter.com/TalkPython/status/858344138420477953\"\u003eTalk Python Podcast\u003c/a\u003e\n\n### Credits:\nThis was made by Ethan Chiu as a research project under the guidance of Wellesley College professor Eni Mustafaraj.\n\n### Other:\nAs of October 2020, PythonBuddy.com will no longer be a demo server for this open-source project due to the increasing costs of hosting it for 80,000+ people monthly. Instead, this URL will redirect back to this GitHub repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanchewy%2FPythonBuddy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethanchewy%2FPythonBuddy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanchewy%2FPythonBuddy/lists"}