{"id":25191464,"url":"https://github.com/guangchen2333/structovo","last_synced_at":"2026-02-12T00:36:20.768Z","repository":{"id":276269973,"uuid":"928733541","full_name":"GuangChen2333/StructOvO","owner":"GuangChen2333","description":"(Python 3.8+) A Python library offering a more concise syntax for data packing.","archived":false,"fork":false,"pushed_at":"2025-02-07T11:47:27.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T04:36:53.742Z","etag":null,"topics":["network","packet","python-struct","python3","python3-library","serialization","struct"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/structovo/","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/GuangChen2333.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}},"created_at":"2025-02-07T06:18:30.000Z","updated_at":"2025-02-28T06:14:53.000Z","dependencies_parsed_at":"2025-04-04T12:43:26.997Z","dependency_job_id":"efb575d9-0b55-4a13-b087-a643052866ec","html_url":"https://github.com/GuangChen2333/StructOvO","commit_stats":null,"previous_names":["guangchen2333/structovo"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/GuangChen2333/StructOvO","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuangChen2333%2FStructOvO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuangChen2333%2FStructOvO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuangChen2333%2FStructOvO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuangChen2333%2FStructOvO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuangChen2333","download_url":"https://codeload.github.com/GuangChen2333/StructOvO/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuangChen2333%2FStructOvO/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29351055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T20:11:40.865Z","status":"ssl_error","status_checked_at":"2026-02-11T20:10:41.637Z","response_time":97,"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":["network","packet","python-struct","python3","python3-library","serialization","struct"],"created_at":"2025-02-09T22:34:16.957Z","updated_at":"2026-02-12T00:36:20.752Z","avatar_url":"https://github.com/GuangChen2333.png","language":"Python","readme":"# StructOvO\n\n![GitHub License](https://img.shields.io/github/license/GuangChen2333/StructOvO?style=flat-square)\n![GitHub Repo stars](https://img.shields.io/github/stars/GuangChen2333/StructOvO?style=flat-square)\n![PyPi](https://img.shields.io/pypi/v/structovo?style=flat-square)\n![Downloads](https://img.shields.io/pypi/dm/structovo?style=flat-square)\n![Python](https://img.shields.io/pypi/pyversions/structovo?style=flat-square)\n\nA Python library offering a more concise syntax for data packing.\n\n## Installation\n\n- From `pypi`\n\n```shell\npip install structovo\n```\n\n## Usage\n\n```python\nfrom structovo import *\n\n\nclass PackA(Packet):\n    a: PADDING\n    b: BYTE = b'A'\n    c: CHAR = -1\n    d: UCHAR = 1\n    e: BOOL = False\n    f: SHORT = -2\n    g: USHORT = 2\n    h: INT = -3\n    i: UINT = 3\n    j: LONG = -4\n    k: ULONG = 4\n    l: LONGLONG = -5\n    m: ULONGLONG = 5\n    n: SIZET = 12\n    o: SSIZET = 34\n    p: BINARY16 = 3.14\n    q: FLOAT = 3.14\n    r: DOUBLE = 3.14\n    s: FixedString = (b\"hello\", 10)\n    t: LengthPrefixedString = b\"world\"\n    u: UnsignedPointer = 0x0d000721\n    v: bytes = b'raw_bytes'\n\n\nr = PackA.build(endianness=Endianness.NATIVE)\nhex_list = [format(byte, '02x') for byte in r]\nhex_str = ' '.join(hex_list)\nprint(hex_str)\n```\n\nAnd you will get:\n\n```text\n00 41 ff 01 00 fe ff 02 00 fd ff ff ff 03 00 00 00 fc ff ff ff 04 00 00 00 fb ff ff ff ff ff ff ff 05 00 00 00 00 00 00 00 0c 00 00 00 00 00 00 00 22 00 00 00 00 00 00 00 48 42 c3 f5 48 40 1f 85 eb 51 b8 1e 09 40 68 65 6c 6c 6f 00 00 00 00 00 05 77 6f 72 6c 64 21 07 00 0d 00 00 00 00 72 61 77 5f 62 79 74 65 73\n```\n\n## Advance\n\n### Supported Endianness\n\n- `Endianness.BIG`: Big-endian\n- `Endianness.LITTLE`: Little-endian\n- `Endianness.NETWORK`: Big-endian\n- `Endianness.NATIVE`: Depend on your device (Default)\n\n### Custom Data Types\n\nYou can define your own data types by simply inheriting the `BaseType` class:\n\n```python\nfrom typing import Tuple, Type\nfrom structovo import BaseType, Endianness\n\n\nclass MyDataType(BaseType):\n    def check_validation(self) -\u003e Tuple[bool, Type]:\n        # Implement the validation of whether the self.value is valid.\n        return ...\n\n    def encode(self, endianness: Endianness) -\u003e bytes:\n        # Implement the operation of converting self.value to bytes.\n        return ...    \n```\n\nLike this: \n\n```python\nfrom typing import Tuple, Type\nfrom structovo import BaseType, Endianness\n\n\nclass BYTE(BaseType):\n    def check_validation(self) -\u003e Tuple[bool, Type]:\n        result = isinstance(self.value, bytes)\n        return result, bytes\n\n    def encode(self, endianness: Endianness) -\u003e bytes:\n        return self._pack('c', endianness)\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguangchen2333%2Fstructovo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguangchen2333%2Fstructovo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguangchen2333%2Fstructovo/lists"}