{"id":17077756,"url":"https://github.com/torokmark/esu","last_synced_at":"2025-06-29T13:03:07.485Z","repository":{"id":57427023,"uuid":"216394546","full_name":"torokmark/esu","owner":"torokmark","description":":egg: Enjoy the flexibility of structs with esu!","archived":false,"fork":false,"pushed_at":"2019-10-27T05:43:12.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T20:02:04.944Z","etag":null,"topics":["metaprogramming","openstruct","python","struct"],"latest_commit_sha":null,"homepage":"https://esu.readthedocs.io/","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/torokmark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-20T16:47:02.000Z","updated_at":"2019-10-27T05:43:14.000Z","dependencies_parsed_at":"2022-09-19T06:51:38.161Z","dependency_job_id":null,"html_url":"https://github.com/torokmark/esu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/torokmark/esu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torokmark%2Fesu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torokmark%2Fesu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torokmark%2Fesu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torokmark%2Fesu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torokmark","download_url":"https://codeload.github.com/torokmark/esu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torokmark%2Fesu/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262598141,"owners_count":23334667,"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":["metaprogramming","openstruct","python","struct"],"created_at":"2024-10-14T12:16:38.161Z","updated_at":"2025-06-29T13:03:07.418Z","avatar_url":"https://github.com/torokmark.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to Esu Structs!\n\n\n[![Build Status](https://travis-ci.org/torokmark/esu.svg?branch=master)](https://travis-ci.org/torokmark/esu)\n[![Documentation Status](https://readthedocs.org/projects/esu/badge/?version=latest)](https://esu.readthedocs.io/en/latest/)\n[![PyPI](https://img.shields.io/pypi/v/esu.svg?color=blue)](https://pypi.org/project/esu/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/esu.svg)](https://github.com/torokmark/esu)\n[![PyPI - License](https://img.shields.io/github/license/torokmark/esu)](https://github.com/torokmark/esu/blob/master/LICENSE.md)\n\n\nEnjoy the flexibility of structs with *esu*!\n\nYou can create types on the fly with previously declared fields and methods by using *esu struct*.  \nThe created type additionally contains methods for equation, hashing and string representation.\n\n### Install\n\n```sh\npip install esu\n```\n\n### Usage\n\n#### Struct\n\n```py\nfrom esu import Struct\n\nCustomer = Struct(\n            'Customer', \n            'name', 'age', \n            methods={\n                'greeting': lambda self: \"Hello {}\".format(self.__dict__['name'])\n            })\n\ndave = Customer()\ndave.name = 'Dave'\ndave.age = 25\ndave.greeting() # =\u003e Hello Dave \n\nanna = Customer('Anna', 28)\nanna.greeting() # =\u003e Hello Anna\n```\n\n#### OpenStruct\n\n```py\nfrom esu import OpenStruct\n\nbob = OpenStruct()\nbob.name = Bob\nbob.age = 54\nprint(bob) # =\u003e [name=Bob, age=54]\n\nsu = OpenStruct({'name': 'Su', 'gender': 'female'})\nsu.employed = True\nprint(su) # =\u003e [name=Su, gender=female, employed=True]\n```\n\n### Documentation\n\nFor further information, read the documentation that can be found: [https://esu.readthedocs.io](https://esu.readthedocs.io)\n\n### Contribution\n\n1. Fork it!\n2. Make your changes!\n3. Send a PR!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorokmark%2Fesu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorokmark%2Fesu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorokmark%2Fesu/lists"}