{"id":13541743,"url":"https://github.com/viblo/pymunk","last_synced_at":"2025-05-13T17:05:18.562Z","repository":{"id":42519937,"uuid":"13273472","full_name":"viblo/pymunk","owner":"viblo","description":"Pymunk is a easy-to-use pythonic 2d physics library that can be used whenever  you need 2d rigid body physics from Python","archived":false,"fork":false,"pushed_at":"2025-05-09T19:31:17.000Z","size":31458,"stargazers_count":981,"open_issues_count":21,"forks_count":192,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-05-09T20:30:57.809Z","etag":null,"topics":["library","physics-2d","physics-engine","physics-simulation","pygame","pyglet","python","python-library"],"latest_commit_sha":null,"homepage":"http://www.pymunk.org","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/viblo.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-10-02T14:36:46.000Z","updated_at":"2025-05-09T12:53:54.000Z","dependencies_parsed_at":"2023-11-10T11:35:20.867Z","dependency_job_id":"0a47954e-17fe-4f49-a0b3-5ea221a92623","html_url":"https://github.com/viblo/pymunk","commit_stats":{"total_commits":1263,"total_committers":21,"mean_commits":"60.142857142857146","dds":0.4584323040380047,"last_synced_commit":"730f1b573cd9e1b538e1e20b2cd5c9069917f8c2"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viblo%2Fpymunk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viblo%2Fpymunk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viblo%2Fpymunk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viblo%2Fpymunk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viblo","download_url":"https://codeload.github.com/viblo/pymunk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990460,"owners_count":21995774,"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":["library","physics-2d","physics-engine","physics-simulation","pygame","pyglet","python","python-library"],"created_at":"2024-08-01T10:00:55.911Z","updated_at":"2025-05-13T17:05:18.533Z","avatar_url":"https://github.com/viblo.png","language":"Python","readme":"Pymunk\r\n======\r\n\r\n.. image::  https://raw.githubusercontent.com/viblo/pymunk/master/docs/src/_static/pymunk_logo_animation.gif\r\n\r\nPymunk is an easy-to-use pythonic 2D physics library that can be used whenever \r\nyou need 2D rigid body physics from Python. Perfect when you need 2D physics \r\nin your game, demo or simulation! It is built on top of the very \r\ncapable 2D physics library `Chipmunk2D \u003chttp://chipmunk-physics.net\u003e`_.\r\n\r\nThe first version was released in 2007 and Pymunk is still actively developed \r\nand maintained today, more than 15 years of active development!\r\n\r\nPymunk has been used with success in many projects, big and small. For example: \r\n3 Pyweek game competition winners, dozens of published scientific \r\npapers and even in a self-driving car simulation! See the Showcases section on \r\nthe Pymunk webpage for some examples.\r\n\r\n2007 - 2025, Victor Blomqvist - vb@viblo.se, MIT License\r\n\r\nThis release is based on the latest Pymunk release (6.11.1), \r\nusing Chipmunk2D 7 rev dfc2fb8ca023ce6376fa2cf4a7f91c92ee08a970.\r\n\r\n\r\nInstallation\r\n------------\r\n\r\nIn the normal case Pymunk can be installed from PyPI with pip::\r\n\r\n    \u003e pip install pymunk\r\n\r\nIt has one direct dependency, CFFI.\r\n\r\nPymunk can also be installed with conda, from the conda-forge channel::\r\n\r\n    \u003e conda install -c conda-forge pymunk\r\n\r\nFor more detailed installation instructions, please see the complete Pymunk \r\ndocumentation.\r\n\r\nExample\r\n-------\r\n\r\nQuick code example::\r\n    \r\n    import pymunk               # Import pymunk..\r\n\r\n    space = pymunk.Space()      # Create a Space which contain the simulation\r\n    space.gravity = 0,-981      # Set its gravity\r\n\r\n    body = pymunk.Body()        # Create a Body\r\n    body.position = 50,100      # Set the position of the body\r\n\r\n    poly = pymunk.Poly.create_box(body) # Create a box shape and attach to body\r\n    poly.mass = 10              # Set the mass on the shape\r\n    space.add(body, poly)       # Add both body and shape to the simulation\r\n\r\n    print_options = pymunk.SpaceDebugDrawOptions() # For easy printing \r\n\r\n    for _ in range(100):        # Run simulation 100 steps in total\r\n        space.step(0.02)        # Step the simulation one step forward\r\n        space.debug_draw(print_options) # Print the state of the simulation\r\n\r\nThis will print (to console) the state of the simulation. For more visual, \r\ndetailed and advanced examples, take a look at the included demos.  \r\nThey are included in the Pymunk install, in the pymunk.examples subpackage. \r\nThey can be run directly. To list the examples::\r\n\r\n    \u003e python -m pymunk.examples -l\r\n\r\nAnd to run one of them::\r\n\r\n    \u003e python -m pymunk.examples.index_video\r\n\r\n\r\nContact \u0026 Support\r\n-----------------\r\n.. _contact-support:\r\n\r\n**Homepage**\r\n    http://www.pymunk.org/\r\n\r\n**Stackoverflow**\r\n    You can ask questions/browse old ones at Stackoverflow, just look for \r\n    the Pymunk tag. http://stackoverflow.com/questions/tagged/pymunk\r\n\r\n**E-Mail**\r\n    You can email me directly at vb@viblo.se\r\n\r\n**Issue Tracker**\r\n    Please use the issue tracker at Github to report any issues you find. This \r\n    is also the place for feature requests:\r\n    https://github.com/viblo/pymunk/issues\r\n    \r\nRegardless of the method you use I will try to answer your questions as soon \r\nas I see them. (And if you ask on Stackoverflow other people might help as \r\nwell!)\r\n\r\n\r\nDocumentation\r\n-------------\r\n\r\nThe full documentation including API reference, showcase of usages and \r\nscreenshots of examples is available on the Pymunk homepage, \r\nhttp://www.pymunk.org\r\n\r\n\r\nThe Pymunk Vision\r\n-----------------\r\n\r\n    \"*Make 2D physics easy to include in your game*\"\r\n\r\nIt is (or is striving to be):\r\n\r\n* **Easy to use** - It should be easy to use, no complicated code should be \r\n  needed to add physics to your game or program.\r\n* **\"Pythonic\"** - It should not be visible that a c-library (Chipmunk) is in \r\n  the bottom, it should feel like a Python library (no strange naming, OO, \r\n  no memory handling and more)\r\n* **Simple to build \u0026 install** - You shouldn't need to have a zillion of \r\n  libraries installed to make it install, or do a lot of command line tricks.\r\n* **Multi-platform** - Should work on both Windows, \\*nix and OSX.\r\n* **Non-intrusive** - It should not put restrictions on how you structure \r\n  your program and not force you to use a special game loop, it should be \r\n  possible to use with other libraries like Pygame and Pyglet. \r\n\r\n  \r\nDependencies / Requirements\r\n---------------------------\r\n\r\nBasically Pymunk have been made to be as easy to install and distribute as \r\npossible, usually `pip install` will take care of everything for you.\r\n\r\n- Python (Runs on CPython 3.8 and later and Pypy3)\r\n- Chipmunk (Prebuilt and included when using binary wheels)\r\n- CFFI (will be installed automatically by Pip)\r\n- Setuptools (should be included with Pip)\r\n\r\n* GCC and friends (optional, you need it to compile Pymunk from source. On \r\n  windows Visual Studio is required to compile)\r\n* Pygame or Pygame-CE (optional, you need it to run the Pygame based demos)\r\n* Pyglet (optional, you need it to run the Pyglet based demos)\r\n* Matplotlib \u0026 Jupyter Notebook (optional, you need it to run the Matplotlib \r\n  based demos)\r\n* Numpy (optional, you need to it run a few demos)\r\n* Sphinx \u0026 aafigure \u0026 sphinx_autodoc_typehints (optional, you need it to build \r\n  documentation)\r\n\r\n\r\nOlder Pythons\r\n-------------\r\n\r\n- Support for Python 2 (and Python 3.0 - 3.5) was dropped with Pymunk 6.0.\r\n- Support for Python 3.6 was dropped with Pymunk 6.5.2.\r\n- Support for Python 3.7 was dropped with Pymunk 6.9.0\r\n\r\nIf you use any of these legacy versions of Python, please use an older \r\nPymunk version. (It might work on newer Pymunks as well, but it's not tested, \r\nand no wheels are built.)\r\n","funding_links":[],"categories":["C","Mechanics","Python"],"sub_categories":["Rigid Bodies and Physics Engines"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviblo%2Fpymunk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviblo%2Fpymunk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviblo%2Fpymunk/lists"}