{"id":16560407,"url":"https://github.com/wangzhe3224/pyca","last_synced_at":"2025-10-10T16:43:25.265Z","repository":{"id":56325574,"uuid":"266150132","full_name":"wangzhe3224/pyca","owner":"wangzhe3224","description":"A more general Python Cellular Automata with multi-dimensions and multi-cell type mix","archived":false,"fork":false,"pushed_at":"2025-02-20T22:17:43.000Z","size":23199,"stargazers_count":26,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-22T19:48:18.282Z","etag":null,"topics":["1d","2d","cellular-automata","cellular-automaton","game-of-life","python","rule30"],"latest_commit_sha":null,"homepage":"","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/wangzhe3224.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-22T15:56:07.000Z","updated_at":"2025-02-20T22:17:47.000Z","dependencies_parsed_at":"2023-02-14T19:01:10.639Z","dependency_job_id":null,"html_url":"https://github.com/wangzhe3224/pyca","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wangzhe3224/pyca","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangzhe3224%2Fpyca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangzhe3224%2Fpyca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangzhe3224%2Fpyca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangzhe3224%2Fpyca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wangzhe3224","download_url":"https://codeload.github.com/wangzhe3224/pyca/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangzhe3224%2Fpyca/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004699,"owners_count":26083751,"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-10T02:00:06.843Z","response_time":62,"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":["1d","2d","cellular-automata","cellular-automaton","game-of-life","python","rule30"],"created_at":"2024-10-11T20:29:08.051Z","updated_at":"2025-10-10T16:43:25.237Z","avatar_url":"https://github.com/wangzhe3224.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](./assets/logo_small.png) \n# pyca \n\n[![Build Status](https://travis-ci.com/wangzhe3224/pyca.svg?branch=master)](https://travis-ci.com/wangzhe3224/pyca)\n\nCellular Automata, CA, in Python.\n\n![2D Cyclic AC](./assets/2d_cyclic_ac.gif)\n\n## Features\n\n- easy to add new rules, check Rule30\n- you can even witch rules during compute\n- multiple dimensions universes (1d and 2d) support\n- support multiply cell types in one universe\n- support customized neighbour search \n- unit tests (more is coming)\n\n## Install\n\n`pip install pycax`\n\n## Get started\n### See something running\n1. Clone the code\n2. Install libraries: `pip install -r requirements.txt`\n3. Pick a script form `example/` folder\n4. Magic...\n### Explore the code\n```python\nfrom pyca.universe1d import Universe1D\nfrom pyca.rules.Rules import Rule30\nfrom pyca.observer import plot1d_universe\n\nuniverse = Universe1D(300)\nuniverse.register_cell_type(Rule30, 'random', prob=0.5)\nuniverse.initialize()\nuniverse.compute(300)\nplot1d_universe(universe)\n```\n\nOr for classic rulexxx system, you can just pus a str represent rule for ClassicRule!\n\n```python\nfrom pyca.universe1d import Universe1D\nfrom pyca.rules.BaseRule import ClassicRule\nfrom pyca.observer import plot1d_universe\n\nsize = 600\nuniverse = Universe1D(size)\nuniverse.register_cell_type(ClassicRule, 'single', pos=size-1, rule='01101110')  # Rule110 here\nuniverse.initialize()\nuniverse.compute(size)\nplot1d_universe(universe)\n```\n\n## Concepts\n\n- Universe, contains all the cells, and function to trigger computation\n- CellType, rule of the cell is defined here\n- observer, way to observe universe, well it can be visual, but it can also be something else, like sounds!\n\nCurrently, 2 2D universe is supported, you can define a CA by injecting a \nnew type of CellType. \n\n## Road map\n\n- [ ] 3D universe\n- [ ] HyperGraph Universe\n- [ ] Interactive Observers\n- [ ] Musical Observers\n\n## Examples:\n\n### Rule 0 - Rule 255\n\n[pngs](./assets/255/)\n\n### 2D Cyclic AC\n\nhttp://psoup.math.wisc.edu/mcell/rullex_cycl.html\n\n[code](./example/2dCyclicAC.py)\n\n![2D Cyclic AC](./assets/2d_cyclic_ac.gif)\n\n### Game of Life\n\nhttps://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\n\n[Code](./example/game_of_life.py)\n\n![A random game of life](./assets/game_of_life.gif)\n\n### Rule30\n\nhttps://en.wikipedia.org/wiki/Rule_30\n\n[Code](./example/rule30.py)\n\n![Rule 30](./assets/rule30.png)\n\n### Rule 110\n\nhttps://en.wikipedia.org/wiki/Rule_110\n\n[Code](./example/rule110.py)\n\n![Rule 110 ani](./assets/rule110_animtion.gif)\n\n![Rule 110](./assets/rule110.png)\n\n### Switch rules\n\n[Code](./example/switch_rules.py)\n\n![Switch Rules](./assets/switch_rules.png)\n\n\n## Related projects\n\n- [Cellular-Automaton-Viewer](https://github.com/jedlimlx/Cellular-Automaton-Viewer)\n- [cellularAutomata, Haskell version](https://github.com/bollu/cellularAutomata)\n- [A CA Game](https://sandspiel.club/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangzhe3224%2Fpyca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangzhe3224%2Fpyca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangzhe3224%2Fpyca/lists"}