{"id":16410166,"url":"https://github.com/stereobutter/cyberdyne","last_synced_at":"2025-09-11T17:16:38.959Z","repository":{"id":107234321,"uuid":"586213248","full_name":"stereobutter/cyberdyne","owner":"stereobutter","description":"A friendly Python library for asynchronous decision making and AI","archived":false,"fork":false,"pushed_at":"2023-03-30T06:19:40.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-06T00:42:15.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/stereobutter.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}},"created_at":"2023-01-07T10:48:28.000Z","updated_at":"2023-03-14T09:56:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"a147414c-3b08-4b70-8454-81788e864547","html_url":"https://github.com/stereobutter/cyberdyne","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/stereobutter%2Fcyberdyne","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stereobutter%2Fcyberdyne/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stereobutter%2Fcyberdyne/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stereobutter%2Fcyberdyne/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stereobutter","download_url":"https://codeload.github.com/stereobutter/cyberdyne/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240405458,"owners_count":19796192,"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":[],"created_at":"2024-10-11T06:23:22.156Z","updated_at":"2025-02-24T02:26:23.183Z","avatar_url":"https://github.com/stereobutter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cyberdyne - a friendly Python library for asynchronous decision making and AI\n\n\n## Installation\n\n```pip install cyberdyne```\n\n\n## Blackboards\n\nBlackboards are useful when programming state machines or behavior trees as a place\nto share state and data with external processes in a program. \n\nCreating a blackboard is as simple as adding a `Field` or `DerivedField` as an \nattribute to a class. Use a `Field` to create a field from an initial value and\n`DerivedField` for a field that depends on the value of one or more other fields \n(including other derived fields). \n\n```python\nfrom cyberdyne.blackboards import Field, DependentField\n\nclass Blackboard:\n    a = Field(1)\n    b = Field(2)\n    c = DerivedField(lambda a, b: a+b, depends_on=(a, b))\n    d = DerivedField(lambda c: 2*c, depends_on=c)\n```\n\nA common use case for blackboards is coordinating multiple state machines \nor behavior trees interacting with each other such as multiple NPCs in a game. \nYou can also effectively use blackboards to structure your program to separate \ndecision making logic (your state machine and/or behavior tree) from I/O \nvia *sensors* (processes that read data from the \noutside world and update the blackboard) and *actuators* (processes that read from\nthe blackboard and write data out to the outside world).\n\n\n```python\nclass Blackboard:\n    should_stop = Field(False)\n\n\nasync def some_state_or_action(blackboard):\n    \"\"\"Some state or action within your state machine or behavior tree.\"\"\"\n    ...\n    # wait for the blackboard's `should_stop` attribute to become `True`\n    await blackboard.should_stop.wait_value(True)\n    ...\n\nasync def some_external_process(blackboard):\n    \"\"\"Some external component that interacts with your state machine\n    or behavior tree via the blackboard.\"\"\"\n    ...\n    # set a new value for the `.should_stop` field\n    blackboard.should_stop = True\n    ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstereobutter%2Fcyberdyne","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstereobutter%2Fcyberdyne","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstereobutter%2Fcyberdyne/lists"}