{"id":24073783,"url":"https://github.com/jpleorx/simplestr","last_synced_at":"2025-10-09T07:33:21.395Z","repository":{"id":57467678,"uuid":"338595961","full_name":"JPLeoRX/simplestr","owner":"JPLeoRX","description":"Simple python package with annotations to automatically generate __str__(self), __repr__(self) and __eq__(self, other) methods in classes","archived":false,"fork":false,"pushed_at":"2022-01-20T16:34:45.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T08:41:50.781Z","etag":null,"topics":["annotations","automatic","equality","generate","generate-code","python","python-3","python3","string"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/simplestr/","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/JPLeoRX.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":"2021-02-13T14:46:10.000Z","updated_at":"2022-01-20T16:34:49.000Z","dependencies_parsed_at":"2022-09-17T18:01:32.235Z","dependency_job_id":null,"html_url":"https://github.com/JPLeoRX/simplestr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPLeoRX%2Fsimplestr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPLeoRX%2Fsimplestr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPLeoRX%2Fsimplestr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPLeoRX%2Fsimplestr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JPLeoRX","download_url":"https://codeload.github.com/JPLeoRX/simplestr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240941515,"owners_count":19882063,"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":["annotations","automatic","equality","generate","generate-code","python","python-3","python3","string"],"created_at":"2025-01-09T17:56:49.134Z","updated_at":"2025-10-09T07:33:16.359Z","avatar_url":"https://github.com/JPLeoRX.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simplestr\nA python package with annotations to automatically generate `__str__(self)`, `__repr__(self)` and `__eq__(self, other)` methods in classes\n\n\n# Description\nThis package provides only two annotations:\n- `@gen_str` to generate `__str__(self)` method\n- `@gen_repr` to generate `__repr__(self)` method\n- `@gen_eq` to generate `__eq__(self, other)` method \n- `@gen_str_repr` to generate both `__str__(self)` and `__repr__(self)` methods\n- `@gen_str_repr_eq` to generate both `__str__(self)`, `__repr__(self)` and `__eq__(self, other)` methods\n\n# Installation\n \n## Normal installation\n\n```bash\npip install simplestr\n```\n\n## Development installation\n\n```bash\ngit clone https://github.com/jpleorx/simplestr.git\ncd simplestr\npip install --editable .\n```\n\n# Example A (with separate annotations)\n```python\nfrom simplestr import gen_str, gen_repr, gen_eq\n\n@gen_str\n@gen_repr\n@gen_eq\nclass Rect:\n    def __init__(self, x: int, y: int, w: int, h: int):\n        self.x = x\n        self.y = y\n        self.w = w\n        self.h = h\n\nrect1 = Rect(1, 2, 3, 4)\nrect2 = Rect(10, 20, 30, 40)\nprint(rect1)\nprint(rect2)\nprint([rect1, rect2])\nprint(rect1 == rect2)\nprint(rect1 == Rect(1, 2, 3, 4))\n```\n\n```\nRect{x=1, y=2, w=3, h=4}\nRect{x=10, y=20, w=30, h=40}\n[Rect{x=1, y=2, w=3, h=4}, Rect{x=10, y=20, w=30, h=40}]\nFalse\nTrue\n```\n\n# Example B (with joined annotation)\n```python\nfrom simplestr import gen_str_repr_eq\n\n@gen_str_repr_eq\nclass Rect:\n    def __init__(self, x: int, y: int, w: int, h: int):\n        self.x = x\n        self.y = y\n        self.w = w\n        self.h = h\n\nrect1 = Rect(1, 2, 3, 4)\nrect2 = Rect(10, 20, 30, 40)\nprint(rect1)\nprint(rect2)\nprint([rect1, rect2])\nprint(rect1 == rect2)\nprint(rect1 == Rect(1, 2, 3, 4))\n```\n\n```\nRect{x=1, y=2, w=3, h=4}\nRect{x=10, y=20, w=30, h=40}\n[Rect{x=1, y=2, w=3, h=4}, Rect{x=10, y=20, w=30, h=40}]\nFalse\nTrue\n```\n\n# Links\nIn case you’d like to check my other work or contact me:\n* [Personal website](https://tekleo.net/)\n* [GitHub](https://github.com/jpleorx)\n* [PyPI](https://pypi.org/user/JPLeoRX/)\n* [DockerHub](https://hub.docker.com/u/jpleorx)\n* [Articles on Medium](https://medium.com/@leo.ertuna)\n* [LinkedIn (feel free to connect)](https://www.linkedin.com/in/leo-ertuna-14b539187/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpleorx%2Fsimplestr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpleorx%2Fsimplestr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpleorx%2Fsimplestr/lists"}