{"id":23467365,"url":"https://github.com/davidhozic/tkclasswizard","last_synced_at":"2025-10-24T16:53:47.654Z","repository":{"id":210701048,"uuid":"718532574","full_name":"davidhozic/TkClassWizard","owner":"davidhozic","description":"Python library for GUI-interactive definition of objects / forms based on annotations (type hints).  It allows the creation of forms based on class's definition. Works with Tkinter / TTKBootstrap.","archived":false,"fork":false,"pushed_at":"2024-11-04T05:42:23.000Z","size":1284,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T01:45:49.895Z","etag":null,"topics":["annotations","auto","class","define","definition","form","forms","generic","gui","hint","interactive","object","python","python3","tkinter","ttkbootstrap","typing","wizard"],"latest_commit_sha":null,"homepage":"https://tkclasswizard.readthedocs.io/","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/davidhozic.png","metadata":{"files":{"readme":"README.rst","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":"2023-11-14T09:26:01.000Z","updated_at":"2025-01-22T20:04:30.000Z","dependencies_parsed_at":"2024-01-22T12:00:12.834Z","dependency_job_id":"c3f8aaf5-41d3-439b-a097-1e04261a8b29","html_url":"https://github.com/davidhozic/TkClassWizard","commit_stats":null,"previous_names":["davidhozic/tkclasswizard"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhozic%2FTkClassWizard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhozic%2FTkClassWizard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhozic%2FTkClassWizard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidhozic%2FTkClassWizard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidhozic","download_url":"https://codeload.github.com/davidhozic/TkClassWizard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248878852,"owners_count":21176393,"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","auto","class","define","definition","form","forms","generic","gui","hint","interactive","object","python","python3","tkinter","ttkbootstrap","typing","wizard"],"created_at":"2024-12-24T12:30:48.793Z","updated_at":"2025-10-24T16:53:42.609Z","avatar_url":"https://github.com/davidhozic.png","language":"Python","readme":"=========================================================\r\nTkClassWizard\r\n=========================================================\r\nTkClassWizard - define objects graphically based on class annotations.\r\nThe library allows users to create abstract \"ObjectInfo\" objects based on the class's parameters, which\r\ncan later be converted to real Python objects and vice versa.\r\n\r\n---------------------\r\nLinks\r\n---------------------\r\n- `Releases \u003chttps://github.com/davidhozic/TkClassWizard/releases\u003e`_\r\n- Need help? Contact me in my `Discord server \u003chttps://discord.gg/DEnvahb2Sw\u003e`_.\r\n- **DOCUMENTATION**: https://tkclasswizard.readthedocs.io/\r\n\r\n---------------------\r\nMain features\r\n---------------------\r\n- Interactive definition of Python objects based on annotations.\r\n- Tkinter based\r\n- JSON templates\r\n- Polymorphism\r\n- Generic classes\r\n- Type aliases\r\n- Data validation\r\n- Conversion of defined data to Python objects and vice-versa.\r\n\r\n----------------------\r\nInstallation\r\n----------------------\r\nTkClassWizard can be installed though command prompt/terminal using the bottom commands.\r\n        \r\nPre-requirement: `Python (minimum v3.9) \u003chttps://www.python.org/downloads/\u003e`_\r\n\r\n\r\n.. code-block:: bash\r\n\r\n    pip install tkclasswiz\r\n\r\n----------------------\r\nExample\r\n----------------------\r\n\r\n.. image:: docs/source/guide/images/new_define_frame_struct_new_str.png\r\n    :width: 15cm\r\n\r\n.. code-block:: python\r\n\r\n    import tkinter as tk\r\n    import tkinter.ttk as ttk\r\n    import tkclasswiz as wiz\r\n\r\n\r\n    # Normal Python classes with annotations (type hints)\r\n    class Wheel:\r\n        def __init__(self, diameter: float):\r\n            self.diameter = diameter\r\n\r\n    class Car:\r\n        def __init__(self, name: str, speed: float, wheels: list[Wheel]):\r\n            self.name = name\r\n            self.speed = speed\r\n            self.wheels = wheels\r\n\r\n    # Tkinter main window\r\n    root = tk.Tk(\"Test\")\r\n\r\n    # Modified tkinter Combobox that will store actual objects instead of strings\r\n    combo = wiz.ComboBoxObjects(root)\r\n    combo.pack(fill=tk.X, padx=5)\r\n\r\n    def make_car(old = None):\r\n        \"\"\"\r\n        Function for opening a window either in new definition mode (old = None) or\r\n        edit mode (old != None)\r\n        \"\"\"\r\n        assert old is None or isinstance(old, wiz.ObjectInfo)\r\n\r\n        window = wiz.ObjectEditWindow()  # The object definition window / wizard\r\n        window.open_object_edit_frame(Car, combo, old_data=old)  # Open the actual frame\r\n\r\n    def print_defined():\r\n        data = combo.get()\r\n        data = wiz.convert_to_objects(data)  # Convert any abstract ObjectInfo objects into actual Python objects\r\n        print(f\"Object: {data}; Type: {type(data)}\",)  # Print the object and it's datatype\r\n\r\n\r\n    # Main GUI structure\r\n    ttk.Button(text=\"Define Car\", command=make_car).pack()\r\n    ttk.Button(text=\"Edit Car\", command=lambda: make_car(combo.get())).pack()\r\n    ttk.Button(text=\"Print defined\", command=print_defined).pack()\r\n    root.mainloop()\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidhozic%2Ftkclasswizard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidhozic%2Ftkclasswizard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidhozic%2Ftkclasswizard/lists"}