{"id":27388325,"url":"https://github.com/rlbot/flatbuffers-python","last_synced_at":"2026-04-14T00:08:29.855Z","repository":{"id":219541595,"uuid":"749299930","full_name":"RLBot/flatbuffers-python","owner":"RLBot","description":"A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers","archived":false,"fork":false,"pushed_at":"2025-09-22T16:48:27.000Z","size":291,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-22T18:47:41.152Z","etag":null,"topics":["flatbuffers","rlbot","rust-lang"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/rlbot-flatbuffers/","language":"Rust","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/RLBot.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-28T06:45:35.000Z","updated_at":"2025-09-22T16:47:51.000Z","dependencies_parsed_at":"2024-03-26T17:29:37.240Z","dependency_job_id":"3556b567-cd31-488d-911c-8d610755f62f","html_url":"https://github.com/RLBot/flatbuffers-python","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"e4b964ec65cdfe7a9bb4143c831ee972dade029c"},"previous_names":["virxec/rlbot_flatbuffers_py","rlbot/flatbuffers-python"],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/RLBot/flatbuffers-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLBot%2Fflatbuffers-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLBot%2Fflatbuffers-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLBot%2Fflatbuffers-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLBot%2Fflatbuffers-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RLBot","download_url":"https://codeload.github.com/RLBot/flatbuffers-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLBot%2Fflatbuffers-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020647,"owners_count":26086895,"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-14T02:00:06.444Z","response_time":60,"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":["flatbuffers","rlbot","rust-lang"],"created_at":"2025-04-13T18:22:16.753Z","updated_at":"2025-10-14T19:10:56.756Z","avatar_url":"https://github.com/RLBot.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## rlbot-flatbuffers\n\nA Python module implemented in Rust for fast and safe serialization and deserialization of RLBot's flatbuffers\n\n### The goal of this project\n\nA majority of the code is auto-generated by `codegen/` upon first compile\nusing the RLBot's schema as defined by the `flatbuffers-schema` submodule.\n\nThis includes the code generated by Planus (`src/planus_flat.rs`),\nthe Python wrapper binds to the generated Rust code (`src/python/`),\nand the Python type hints (`rlbot_flatbuffers.pyi`).\n\nUsage of this API should not significantly differ from RLBot v4 to reduce developer confusion, while not holding back changes that would make the API easier to work with.\n\n### Minimum support Python version\n\nThe crate used to generate Python binds (PyO3) supports all the way back to Python 3.7, however the minimum supported Python version is 3.10 for a few reasons:\n\n1. RLBot v4 currently runs Python 3.11\n1. The RLBot v5's [Python interface](https://github.com/RLBot/python-interface) has a minimum Python version of 3.11, but the difference between 3.10 and 3.11 doesn't mean much for these binds specifically.\n1. Python 3.10 is the version of Python that added `match`/`case`\n1. [Python 3.7 \u0026 3.8 are EOL, with 3.9's EOL date being 2025-10](https://devguide.python.org/versions/)\n\n### Dev setup\n\n- Ensure Python 3.10+ is installed\n- Create a virtual Python environment\n    - `python3 -m venv venv`\n- Activate the virtual environment\n    - Windows: `venv\\Scripts\\activate.bat`\n    - Linux: `source venv/bin/activate`\n- Install maturin\n    - `pip install maturin`\n- Build \u0026 install for testing\n    - `maturin develop --release`\n\nTo use in another Python environment, like if testing [python-interface](https://github.com/RLBot/python-interface), you can build the wheel:\n\n- `maturin build --release`\n- (In another environment) `pip install path/to/file.whl`\n\nThe exact path of the wheel will be printed by maturin, just copy+paste it.\n\n### Basic usage\n\nAll classes and methods should have types hints readable by your IDE, removing the guesswork of common operations.\n\n#### Creating\n\n```python\nimport rlbot_flatbuffers as flat\n\ndesired_ball = flat.DesiredBallState(\n    physics=flat.Physics(\n        location=flat.Vector3Partial(z=200),\n        velocity=flat.Vector3Partial(x=1500, y=1500),\n        angular_velocity=flat.Vector3Partial(),\n    ),\n)\n\ndesired_game_info = flat.DesiredGameInfoState(\n    world_gravity_z=-100,\n    game_speed=2,\n)\n\ndesired_game_state = flat.DesiredGameState(\n    ball_state=desired_ball,\n    game_info_state=desired_game_info,\n)\n```\n\nIn the above code, we:\n\n- Set the ball to:\n    - Location (0, 0, 200)\n    - Velocity (1500, 1500, 0)\n    - Angular velocity of (0, 0, 0)\n- Don't set the car states\n- Set the game info state:\n    - World gravity to -100\n    - Game speed to 2x default\n    - Don't set end match or paused\n- Don't set any console commands\n\nAll values are optional when creating a class and have the proper defaults.\n\n#### Reading values\n\n```python\nimport rlbot_flatbuffers as flat\n\ndef handle_packet(packet: flat.GamePacket):\n    if packet.match_info.match_phase not in {\n        flat.MatchPhase.Active,\n        flat.MatchPhase.Kickoff,\n    }:\n        # Return early if the game isn't active\n        return\n\n    # Print the ball's location\n    print(packet.ball.physics.location)\n\n    for car in packet.players:\n        # Print the every car's location\n        print(car.physics.location)\n```\n\nThe goal of the above was to feel familiar to RLBot v4 while providing a more Pythonic interface.\n\n- Unions aren't custom types, rather a normal Python variable that can be 1 of a few types.\n    - For example, previously [`BallInfo.shape` had the separate type `CollisionShape` which contained the union's data](https://github.com/RLBot/RLBot/blob/e34dd4598bc643e2b8e50b77f7ffe4ca38e335de/src/main/python/rlbot/utils/structures/game_data_struct.pyi#L65-L95) but the type is now just `BoxShape | CylinderShape | SphereShape`\n\n- Classes implement `__match_args__` for easy destructuring via the `match`/`case` pattern.\n    - Enums can still be used to match against the type,\n      they just can't be destructured.\n- Classes and enums properly implement `__repr__`, with `__str__` being an alias.\n- Enums implement `__hash__`, `__int__` and `__eq__`.\n- Lists no longer have `num_x` fields accompanying them,\n  they are just Python lists of the appropriate length.\n- Classes implement `pack` and `unpack`,\n  which are used to serialize and deserialize data.\n    - These are public methods that can be used directly for any purpose,\n      for example saving `flat.GamePacket` to a file.\n\n- Auto-generated python type stub (`.pyi`) generation that includes doc comments from the Flatbuffers schema\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlbot%2Fflatbuffers-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frlbot%2Fflatbuffers-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlbot%2Fflatbuffers-python/lists"}