{"id":20515361,"url":"https://github.com/guilt/colfer-python","last_synced_at":"2025-10-07T13:13:59.067Z","repository":{"id":62563518,"uuid":"249367011","full_name":"guilt/colfer-python","owner":"guilt","description":"colf: A strong typed version of Colfer serialization/deserialization for Python.","archived":false,"fork":false,"pushed_at":"2020-05-27T07:20:37.000Z","size":173,"stargazers_count":2,"open_issues_count":9,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-01T09:42:41.870Z","etag":null,"topics":["colf","colfer","library","python","serialization"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/colf/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guilt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-23T07:49:31.000Z","updated_at":"2025-07-03T01:40:38.000Z","dependencies_parsed_at":"2022-11-03T15:45:17.674Z","dependency_job_id":null,"html_url":"https://github.com/guilt/colfer-python","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/guilt/colfer-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fcolfer-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fcolfer-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fcolfer-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fcolfer-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guilt","download_url":"https://codeload.github.com/guilt/colfer-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilt%2Fcolfer-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274381425,"owners_count":25274603,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"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":["colf","colfer","library","python","serialization"],"created_at":"2024-11-15T21:21:10.447Z","updated_at":"2025-10-07T13:13:54.023Z","avatar_url":"https://github.com/guilt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python-Colfer\n\nA strong typed version of *Colfer* serialization/deserialization for Python.\n\n## Usage\n\nFirst install with PyPi\n\n```bash\npip install colf\n```\n\nThen use it to construct a Colfer Object and use it:\n\n```python\nfrom colf import Colfer\n\nclass TestType(Colfer):\n\n    def __init__(self):\n        super(Colfer, self).__init__()\n        self.declareAttribute('radius', 'float64')\n        self.declareAttribute('test', 'bool')\n        self.declareAttribute('inner', 'object')\n\n    def marshall(self, byteOutput, offset=0):\n        offset = self.marshallFloat64(self.radius, 0, byteOutput, offset)\n        offset = self.marshallBool(self.test, 1, byteOutput, offset)\n        offset = self.marshallObject(self.inner, 2, byteOutput, offset)\n        return offset\n\n    def unmarshall(self, byteInput, offset=0):\n        self.radius, offset = self.unmarshallFloat64(0, byteInput, offset)\n        self.test, offset = self.unmarshallBool(1, byteInput, offset)\n        self.inner, offset = self.unmarshallObject(2, byteInput, offset)\n        return self, offset\n\n# Write to Somewhere\nexampleObject = TestType()\nexampleObject.radius = 2.5\nexampleObject.test = True\nexampleObject.inner = TestType()\nexampleObject.inner.radius = 3.0\nbyteOutput = bytearray(30)\nlength = exampleObject.marshall(byteOutput)\nprint(byteOutput[:length])\n\n# Read from Somewhere\ndeserializedObject, _ = TestType().unmarshall(byteOutput[:length])\nprint(deserializedObject, deserializedObject.inner)\n```\n\n## Running Unit Tests\n\n```bash\npip install tox\ntox\n```\n\n## Call for Testing Volunteers\n\nThe code was tested on Python 2.7, 3.6, 3.7, 3.8.\n \nThis code has been tested on Little-Endian machines only. It\nrequires to be tested on other architectures such as PowerPC, or those\nwith unique floating point formats.\n\nAlso, there may be chances this code may not work on some Python\nversion due to nuances not previously uncovered.\n\nPlease volunteer to test it on as many exotic computers, OSes\nand send in your patches (or) bug reports.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilt%2Fcolfer-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguilt%2Fcolfer-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilt%2Fcolfer-python/lists"}