{"id":34044943,"url":"https://github.com/ghulq/python-bedrock","last_synced_at":"2026-04-02T17:27:07.723Z","repository":{"id":325721613,"uuid":"1081493851","full_name":"ghulq/python-bedrock","owner":"ghulq","description":"Async Python reimplementation of the Bedrock protocol.","archived":false,"fork":false,"pushed_at":"2025-10-23T16:45:01.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-19T14:54:24.297Z","etag":null,"topics":["async","bedrock","client","minecraft"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/python-bedrock/","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/ghulq.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":"2025-10-22T21:33:47.000Z","updated_at":"2025-10-23T16:45:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ghulq/python-bedrock","commit_stats":null,"previous_names":["ghulq/python-bedrock"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ghulq/python-bedrock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghulq%2Fpython-bedrock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghulq%2Fpython-bedrock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghulq%2Fpython-bedrock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghulq%2Fpython-bedrock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghulq","download_url":"https://codeload.github.com/ghulq/python-bedrock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghulq%2Fpython-bedrock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31311478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["async","bedrock","client","minecraft"],"created_at":"2025-12-13T23:03:03.684Z","updated_at":"2026-04-02T17:27:07.713Z","avatar_url":"https://github.com/ghulq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-bedrock\n\nAsync Python reimplementation of the Bedrock (Minecraft) network protocol.\n\nThis project provides an asyncio-based library that mirrors the structure and basic API of the original JavaScript `bedrock-protocol` prototype. It aims to offer lightweight building blocks for creating Bedrock-compatible clients and servers, packet datatypes, and transforms (serialization/encryption).\n\nKey features\n- Async client and server primitives (`createClient`, `createServer`) matching an evented API\n- Connection and packet helpers in `python_bedrock.connection` and `python_bedrock.transforms`\n- Packet datatypes and (de)serialization utilities under `python_bedrock.datatypes`\n- Example scripts in the `examples/` folder and unit tests in `tests/`\n\nRequirements\n- Python 3.9+\n- Dependencies declared in `pyproject.toml`: `aiohttp`, `pyjwt`, `cryptography`\n\nInstallation\n\nInstall from source in editable mode for development:\n\n```bash\npython -m pip install -e .\n```\n\nOr build a wheel and install (poetry/build-system is configured via `pyproject.toml`):\n\n```bash\npython -m build\npython -m pip install dist/python_bedrock-*.whl\n```\n\nQuickstart\n\nBasic client (connects to a Bedrock server and starts the reader loop):\n\n```python\nimport asyncio\nfrom python_bedrock import createClient\n\nasync def main():\n\tclient = await createClient('127.0.0.1', 19132)\n\n\t# Register handlers\n\tclient.on('packet', lambda pkt: print('raw packet', pkt))\n\tclient.on('text', lambda message, source: print(f'{source}: {message}'))\n\n\t# Keep running until disconnected\n\ttry:\n\t\tawait asyncio.sleep(3600)\n\tfinally:\n\t\tawait client.disconnect()\n\nasyncio.run(main())\n```\n\nBasic server:\n\n```python\nimport asyncio\nfrom python_bedrock import createServer\n\nasync def run_server():\n\tsrv = createServer('0.0.0.0', 19132)\n\n\t# Register events\n\tsrv.on('listening', lambda info: print('listening on', info))\n\tsrv.on('connect', lambda client: print('client connected', client))\n\n\t# Start listening\n\tawait srv.listen()\n\n\ttry:\n\t\tawait asyncio.Event().wait()  # run forever\n\tfinally:\n\t\tawait srv.close()\n\nasyncio.run(run_server())\n```\n\nAPI overview\n\n- `python_bedrock.createClient(host, port, **options)` — asynchronous helper that opens a TCP connection, returns a started `Client` instance. The returned `Client` implements an evented API (`on`, `off`, `_emit`) and packet helpers such as `queue(packetId, payload)` and `sendMessage(message)`.\n- `python_bedrock.createServer(host, port, **options)` — returns a `Server` instance. Call `await server.listen()` to start listening. The `Server` emits events such as `listening`, `connect`, `disconnect`, and `error`. Use `server.broadcast(packetName, payload)` to send packets to all clients.\n- `python_bedrock.Connection` — low-level connection wrapper used internally; exposes `send`, `receive` and `close`.\n- `python_bedrock.datatypes` — packet classes with `serialize()` and `deserialize()` helpers. See `tests/test_packets.py` for examples of packet construction and roundtrip assertions.\n\nExamples and tests\n\n- Examples are available in the `examples/` directory (`simple_client.py`, `simple_server.py`, etc.). They are minimal stubs demonstrating API usage.\n- Unit tests use `pytest`. Run the test suite with:\n\n```bash\npython -m pytest -q\n```\n\nContributing\n\nContributions are welcome. For small changes, open a pull request with a clear description. Please:\n\n- Run and update tests where appropriate\n- Keep API changes backwards compatible when possible\n- Follow existing code style and type hints\n\nNotes and limitations\n\n- This library is an independent reimplementation and does not provide complete feature parity with the original JS project. It focuses on core packet types and a small, evented runtime useful for experimentation and integration tests.\n- Some example scripts are intentionally minimal and do not perform full protocol handshakes. See `python_bedrock/handshake` and `python_bedrock/auth` for more advanced pieces.\n\nLicense\n\nMIT — see the `LICENSE` file for details.\n\nAcknowledgements\n\nThis project mirrors ideas from the JavaScript `bedrock-protocol` project. See the parent repository for protocol-level documentation and packet specifications.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghulq%2Fpython-bedrock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghulq%2Fpython-bedrock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghulq%2Fpython-bedrock/lists"}