{"id":17002934,"url":"https://github.com/jleclanche/binreader","last_synced_at":"2025-04-12T06:33:23.847Z","repository":{"id":57415167,"uuid":"153040404","full_name":"jleclanche/binreader","owner":"jleclanche","description":"BinaryReader for Python","archived":false,"fork":false,"pushed_at":"2019-03-22T02:21:29.000Z","size":5,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T13:02:53.918Z","etag":null,"topics":["binary","bytes","parsing"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/binreader/","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/jleclanche.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}},"created_at":"2018-10-15T02:13:03.000Z","updated_at":"2024-05-31T16:53:48.000Z","dependencies_parsed_at":"2022-09-01T16:51:57.313Z","dependency_job_id":null,"html_url":"https://github.com/jleclanche/binreader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleclanche%2Fbinreader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleclanche%2Fbinreader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleclanche%2Fbinreader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleclanche%2Fbinreader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jleclanche","download_url":"https://codeload.github.com/jleclanche/binreader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248529582,"owners_count":21119535,"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":["binary","bytes","parsing"],"created_at":"2024-10-14T04:29:24.154Z","updated_at":"2025-04-12T06:33:23.807Z","avatar_url":"https://github.com/jleclanche.png","language":"Python","readme":"# binreader - BinaryReader for Python\n\nA BinaryReader class for Python 3.6+.\n\n\n## Usage\n\n### binreader.BinaryReader\n\nInstanciate a BinaryReader class:\n\n```py\nfrom binreader import BinaryReader\n\nwith open(\"example.bin\", \"rb\") as f:\n\treader = BinaryReader(f)\n\tprint(reader.read_int())  # Reads an int32, returns a Python int\n```\n\nThe following read methods are available:\n\n- `read_bool()` -\u003e `bool`\n- `read_byte()` -\u003e `int`\n- `read_ubyte()` -\u003e `int`\n- `read_int16()` -\u003e `int`\n- `read_uint16()` -\u003e `int`\n- `read_int32()` -\u003e `int`\n- `read_uint32()` -\u003e `int`\n- `read_int64()` -\u003e `int`\n- `read_uint64()` -\u003e `int`\n- `read_int()` -\u003e `int` (alias of `read_int32()`)\n- `read_uint()` -\u003e `int` (alias of `read_uint32()`)\n- `read_float()` -\u003e `float`\n- `read_double()` -\u003e `float`\n\nThe following string read methods are available:\n\n- `read_cstring()` -\u003e `bytes`: Reads a null-terminated string.\n- `read_string(size: int=None)` -\u003e `str`: Reads and decodes a string of size `size`. If `size` is `None`, expects a null terminator.\n\nThe following utility methods are available:\n\n- `align()`: Seeks forward to align the buffer's handle position on a multiple of 4 bytes.\n- `read(*args)`: Calls `read(*args)` on the buffer.\n- `seek(*args)`: Calls `seek(*args)` on the buffer.\n- `tell()`: Returns the buffer's handle position.\n- `read_struct(format)`: Read a struct from the buffer, returning a tuple of that struct.\n  Size is automatically calculated. Endianness defaults to the reader's endianness, but may be overridden.\n\n\n## License\n\nThis project is licensed under the MIT license. The full license text is\navailable in the LICENSE file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjleclanche%2Fbinreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjleclanche%2Fbinreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjleclanche%2Fbinreader/lists"}