{"id":19054667,"url":"https://github.com/ssbuild/data_serialize","last_synced_at":"2026-02-27T03:02:12.697Z","repository":{"id":242062426,"uuid":"808587315","full_name":"ssbuild/data_serialize","owner":"ssbuild","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-02T06:12:03.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-10-19T18:43:45.991Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssbuild.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":"2024-05-31T11:31:49.000Z","updated_at":"2025-05-02T06:12:07.000Z","dependencies_parsed_at":"2024-05-31T12:52:05.513Z","dependency_job_id":"f16cf0eb-b731-4275-b3f9-8852d927a9df","html_url":"https://github.com/ssbuild/data_serialize","commit_stats":null,"previous_names":["ssbuild/data_serialize"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ssbuild/data_serialize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Fdata_serialize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Fdata_serialize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Fdata_serialize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Fdata_serialize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssbuild","download_url":"https://codeload.github.com/ssbuild/data_serialize/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Fdata_serialize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29883111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"online","status_checked_at":"2026-02-27T02:00:06.759Z","response_time":57,"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":[],"created_at":"2024-11-08T23:39:20.358Z","updated_at":"2026-02-27T03:02:12.681Z","avatar_url":"https://github.com/ssbuild.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# data_serialize\n\nThis library allows reading and writing binary to string \n\n## Installation\n\n```pip3 install data_serialize```\n\n\n## serialize and deserialize\n\n```python\n#\nimport data_serialize\nimport numpy as np\n\n\ndef test_feature():\n    val1 = data_serialize.Int64List(value=[1, 2, 3] * 20)\n    val2 = data_serialize.FloatList(value=[1, 2, 3] * 20)\n    val3 = data_serialize.BytesList(value=[b'The china', b'boy'])\n\n    featrue = data_serialize.Features(feature=\n    {\n        \"item_0\": data_serialize.Feature(int64_list=val1),\n        \"item_1\": data_serialize.Feature(float_list=val2),\n        \"item_2\": data_serialize.Feature(bytes_list=val3)\n    }\n    )\n\n    example = data_serialize.Example(features=featrue)\n\n    # 序列化\n    serialize = example.SerializeToString()\n    print(serialize)\n\n    # 反序列化\n    example = data_serialize.Example()\n    example.ParseFromString(serialize)\n    print(example)\n\n\ndef test_numpyobject():\n    a = np.random.randint(0, 21128, size=(10,), dtype=np.int64)\n    b = np.random.rand(3, 4)\n    c = np.asarray(b'The china')\n\n    val1 = data_serialize.NumpyObject(\n        header='',\n        dtype=str(a.dtype),\n        shape=list(a.shape),\n        int64=a.reshape((-1,)).tolist(),\n    )\n    val2 = data_serialize.NumpyObject(\n        header='',\n        dtype=str(b.dtype),\n        shape=list(b.shape),\n        float64=b.reshape((-1,)).tolist(),\n    )\n    val3 = data_serialize.NumpyObject(\n        header='',\n        dtype=str(c.dtype),\n        shape=list(c.shape),\n        bytes=c.tobytes(),\n    )\n\n    example = data_serialize.NumpyObjectMap(numpyobjects={\n        \"item_0\": val1,\n        \"item_1\": val2,\n        \"item_2\": val3}\n    )\n    # 序列化\n    serialize = example.SerializeToString()\n    print(serialize)\n\n    # 反序列化\n    example = data_serialize.NumpyObjectMap()\n    example.ParseFromString(serialize)\n    print(example)\n\n\ntest_feature()\n\ntest_numpyobject()\n\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbuild%2Fdata_serialize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssbuild%2Fdata_serialize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbuild%2Fdata_serialize/lists"}