{"id":16860990,"url":"https://github.com/nickmcintyre/ipycc","last_synced_at":"2025-12-13T16:04:07.260Z","repository":{"id":63149863,"uuid":"399968532","full_name":"nickmcintyre/ipycc","owner":"nickmcintyre","description":"A Python package for creative coding in Jupyter","archived":false,"fork":false,"pushed_at":"2023-06-13T04:17:01.000Z","size":338,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T06:06:46.698Z","etag":null,"topics":["jupyter-notebook","p5js","processing","python","turtle-graphics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickmcintyre.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":"2021-08-25T22:06:28.000Z","updated_at":"2023-04-02T03:51:16.000Z","dependencies_parsed_at":"2025-02-19T01:41:45.898Z","dependency_job_id":null,"html_url":"https://github.com/nickmcintyre/ipycc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmcintyre%2Fipycc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmcintyre%2Fipycc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmcintyre%2Fipycc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmcintyre%2Fipycc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickmcintyre","download_url":"https://codeload.github.com/nickmcintyre/ipycc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248361827,"owners_count":21090991,"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":["jupyter-notebook","p5js","processing","python","turtle-graphics"],"created_at":"2024-10-13T14:28:32.878Z","updated_at":"2025-12-13T16:04:07.250Z","avatar_url":"https://github.com/nickmcintyre.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [ipycc](https://ipy.cc)\n\u003e A Python package for creative coding in Jupyter\n\nipycc is a friendly tool for learning to code, making art, and exploring mathematics within [Jupyter](https://jupyter.org/) notebooks. Try it out at [https://code.ipy.cc](https://code.ipy.cc)!\n\nipycc's `Sketch` class provides a beginner-friendly API for drawing that is heavily inspired by [p5.js](https://p5js.org). `Sketch` lovingly borrows from p5.js' source code and documentation, and mimics [py5](https://py5coding.org/) where possible. Under the hood, it uses the powerful [ipycanvas](https://ipycanvas.readthedocs.io/en/latest/index.html) package for drawing.\n\nThe package also includes a (mostly) drop-in replacement for [Turtle graphics](https://docs.python.org/3/library/turtle.html) from the Python standard library. The `Turtle` class is based on the standard library's implementation and uses the `Sketch` class for rendering. ipycc bundles the standard library's `Vec2D` class for vector arithmetic along with a few helper functions.\n\nipycc runs smoothly in [JupyterLite](https://jupyterlite.readthedocs.io/en/stable/howto/index.html), creating a nice way to start coding in the web browser without installing any software.\n\n## A tour of ipycc\n\nHere are a few quick examples of ipycc in action.\n\n### Sketches\n\nA light gray square with a circle in its center. The circle is drawn with a white center and a black edge.\n```python\nfrom ipycc.sketch import Sketch\n\n# Create a sketch and show it.\ns = Sketch()\ns.show()\n\n# Paint the background.\ns.background(200)\n\n# Draw a circle.\ns.circle(50, 50, 20)\n```\n\nA purple square with a circle in its center. The circle is drawn with a pink center and a thick white edge.\n```python\nfrom ipycc.sketch import Sketch\n\n# Create a sketch and show it.\ns = Sketch(400, 400)\ns.show()\n\n# Paint the background.\ns.background(\"darkorchid\")\n\n# Style the circle.\ns.stroke_weight(5)\ns.stroke(\"ghostwhite\")\ns.fill(\"fuchsia\")\n\n# Draw the circle.\ns.circle(200, 200, 100)\n```\n\nA purple square with a circle in its center. The circle is drawn with a pink center and a thick white edge. It moves slowly to the right.\n```python\nfrom ipycc.sketch import Sketch\n\n# Create a sketch and show it.\ns = Sketch(400, 400)\ns.show()\n\n# Define a function to draw frames in an animation.\ndef draw():\n    # Paint the background.\n    s.background(\"darkorchid\")\n\n    # Calculate the circle's x-coordinate.\n    x = s.frame_count * 3\n\n    # Style the circle.\n    s.stroke_weight(5)\n    s.stroke(248, 248, 255)\n    s.fill(\"#FF00FF\")\n\n    # Draw the circle.\n    s.circle(x, 200, 100)\n\n# Run the animation for 5 seconds.\ns.run_sketch(draw, 5)\n```\n\n### Turtles\n\nA white square with a short black line extending from the center to the right. A black arrow tip at the end of the line points up.\n```python\nfrom ipycc.turtle import Turtle, showscreen\n\n# Show the screen.\nshowscreen()\n\n# Create a turtle.\nt = Turtle()\n\n# Draw a line.\nt.forward(50)\n# Turn left.\nt.left(90)\n```\n\nA white square with the outline of a smaller black square. The smaller square is drawn one side at a time.\n```python\nfrom ipycc.turtle import Turtle, showscreen\n\n# Show the screen.\nshowscreen()\n\n# Create a turtle.\nt = Turtle()\n\n# Draw a square.\nfor i in range(4):\n    t.forward(50)\n    t.left(90)\n```\n\nA black square with a sprial pattern drawn in green. The spiral is drawn one side at a time.\n```python\nfrom ipycc.turtle import Turtle, showscreen\n\n# Show the screen.\nshowscreen()\n\n# Create a turtle.\nt = Turtle()\n\n# Style the turtle.\nt.bgcolor(\"black\")\nt.color(0, 1, 0)\n\n# Draw a spiral.\nfor i in range(40):\n    length = i * 5\n    t.forward(length)\n    t.left(90)\n```\n\n## Installation\n\nIf you'd like to install ipycc locally on your computer, start by [downloading Python](https://www.python.org/downloads/). You can then create a virtual environment, install ipycc, and launch JupyterLab from your system shell like so:\n\nOn Linux/macOS:\n```sh\nmkdir ipycc\ncd ipycc\npython3 -m venv venv\nsource venv/bin/activate\npip install jupyterlab ipycc\njupyter lab\n```\n\nOn Windows:\n```powershell\nmkdir ipycc\ncd ipycc\npy -m venv venv\nvenv\\Scripts\\activate\npip install jupyterlab ipycc\njupyter lab\n```\n\nThe [Python Packaging User Guide](https://packaging.python.org/en/latest/tutorials/installing-packages/) has additional information to help you get up and running.\n\n### 💡 Local alternatives\n\nIf you're running ipycc locally, you may also be interested in [py5](https://py5coding.org/) which uses [Processing](https://processing) for drawing. py5 has advanced features that you may wish to explore at some point.\n\nThe standard library's version of Turtle graphics doesn't run in the web browser, but you can run it locally from Jupyter using the following [magic command](https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-gui):\n\n```python\nfrom turtle import Turtle\n\n%gui tk\n\nt = Turtle()\nt.forward(50) # opens in a separate window\n```\n\n## License\n\nipycc is licensed under the [GNU Lesser General Public License v3.0](https://choosealicense.com/licenses/lgpl-3.0/).\n\n## Contributing\n\nFound a bug or typo? Want a new feature? Feel free to open an issue in the project's [GitHub repository](https://github.com/nickmcintyre/ipycc)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickmcintyre%2Fipycc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickmcintyre%2Fipycc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickmcintyre%2Fipycc/lists"}