{"id":43688627,"url":"https://github.com/friedkeenan/pak","last_synced_at":"2026-02-05T03:05:40.473Z","repository":{"id":41264550,"uuid":"369426888","full_name":"friedkeenan/pak","owner":"friedkeenan","description":"A general purpose packet marshaling library","archived":false,"fork":false,"pushed_at":"2025-08-01T23:09:15.000Z","size":634,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-30T05:42:09.448Z","etag":null,"topics":["networking","protocol-analyser","protocol-parser","python","reverse-engineering"],"latest_commit_sha":null,"homepage":"https://pak.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/friedkeenan.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}},"created_at":"2021-05-21T05:48:45.000Z","updated_at":"2025-08-01T23:09:18.000Z","dependencies_parsed_at":"2024-06-02T03:49:11.007Z","dependency_job_id":"51472acf-aecb-4b41-8be2-1bc3f81c6a29","html_url":"https://github.com/friedkeenan/pak","commit_stats":null,"previous_names":["friedkeenan/pak"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/friedkeenan/pak","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedkeenan%2Fpak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedkeenan%2Fpak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedkeenan%2Fpak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedkeenan%2Fpak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friedkeenan","download_url":"https://codeload.github.com/friedkeenan/pak/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedkeenan%2Fpak/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29108389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T02:48:39.389Z","status":"ssl_error","status_checked_at":"2026-02-05T02:48:27.400Z","response_time":65,"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":["networking","protocol-analyser","protocol-parser","python","reverse-engineering"],"created_at":"2026-02-05T03:05:39.849Z","updated_at":"2026-02-05T03:05:40.461Z","avatar_url":"https://github.com/friedkeenan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pak\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/friedkeenan/pak/ci.yml?label=checks)](https://github.com/friedkeenan/pak/commit/HEAD)\n[![Read the Docs](https://img.shields.io/readthedocs/pak)](https://pak.readthedocs.io/)\n[![Codecov](https://img.shields.io/codecov/c/github/friedkeenan/pak)](https://app.codecov.io/gh/friedkeenan/pak)\n[![License](https://img.shields.io/github/license/friedkeenan/pak)](https://github.com/friedkeenan/pak/blob/main/LICENSE)\n[![Python Version Support](https://img.shields.io/pypi/pyversions/pak)](https://pypi.org/project/pak/)\n\nPak is a simple, yet powerful and extendable Python library for translating between raw data and usable, meaningful values.\n\nHere's an example of simple usage:\n\n```py\nimport pak\n\nraw_data = (\n    # Represents the value '0'.\n    b\"\\x00\" +\n\n    # A string encoded in 4 bytes, with characters \"abcd\".\n    b\"\\x04\" + b\"abcd\" +\n\n    # Two contiguous 16-bit, little-endian numbers, '1' and '2'.\n    b\"\\x01\\x00\" + b\"\\x02\\x00\"\n)\n\nclass MyPacket(pak.Packet):\n    byte:   pak.Int8\n    string: pak.PrefixedString(pak.UInt8)\n    array:  pak.UInt16[2]\n\n# Unpack a packet from the raw data.\npacket = MyPacket.unpack(raw_data)\n\n# Each field will have the appropriate value unpacked from the raw data.\nassert packet == MyPacket(\n    byte   = 0,\n    string = \"abcd\",\n    array  = [1, 2],\n)\n\n# Pack the packet into raw data.\npacket_data = packet.pack()\n\n# The packed data will be the same as the initial raw data.\nassert packet_data == raw_data\n```\n\n## Features\n\n- A declarative, simple API for defining packet structures.\n- Highly generic, able to fit any packet protocol with relative ease.\n- The ability to define your own means of marshaling between raw data and usable values.\n- A composable API to allow you to easily leverage pre-existing code and reduce code duplication.\n- A healthy set of provided features with general application, such as marshaling numeric, string, and enum values.\n- Numerous high quality tests to make sure your code works as expected.\n- Well-documented to help you know what APIs exist and how to use them.\n- And more!\n\n## Installation\n\nTo install Pak, simply install through pip:\n\n```\n$ pip install pak\n```\n\n## Documentation\n\nThe documentation for Pak lives at https://pak.readthedocs.io. There you will find tutorials, including a quickstart, and a reference manual detailing the API that Pak provides.\n\n## Goals\n\nThe impetus for creating this library was that I was making a library for the Minecraft networking protocol, which had a very similar API to the one now in Pak. I then wanted to write code for other protocols, and found myself duplicating much of the code I had written for Minecraft's protocol. I therefore created this library so that I did not need to repeat myself for each and every protocol I wrote code for. And so, from that inciting motivation, these are Pak's goals:\n\n- Above all else, maintain a pleasing and readable API.\n- Be easily workable with many if not all packet protocols.\n- Have a solid base of fundamental or generally applicable features.\n- Be easily extendable to account for all the quirks a particular protocol might have.\n- Be a venue for me to learn about API design and project maintenance.\n\nIn particular Pak's goals do not include performance. I have not benchmarked the library, and I don't currently intend to go through and make sure all code is optimized, though I of course make no conscious effort to pessimize code either. I may in the future go through and improve the performance of particular features, but in general performance is not something in particular that I strive for.\n\n## Credits\n\n- [ammaraskar/pyCraft](https://github.com/ammaraskar/pyCraft) for my initial inspiration to embark on creating this library and its API, even though it did not result in much resemblance.\n- [ManimCommunity/manim](https://github.com/ManimCommunity/manim/) for giving me experience in writing tests and docs and maintaining a serious project.\n- [The beginner's guide from Write the Docs](https://www.writethedocs.org/guide/writing/beginners-guide-to-docs/) for an excellent walkthrough of good documentation practices.\n- The various protocols I stress-tested Pak with to ensure that it is sufficiently generic and easy to use with a wide range of formats. These protocols include but are not limited to those of [Minecraft](https://www.minecraft.net/), [Transformice](https://www.transformice.com/), [CraftyBoss/SuperMarioOdysseyOnline](https://github.com/CraftyBoss/SuperMarioOdysseyOnline), and [Pwn Adventure 3: Pwnie Island](https://www.pwnadventure.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriedkeenan%2Fpak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriedkeenan%2Fpak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriedkeenan%2Fpak/lists"}