{"id":24388221,"url":"https://github.com/frewtypebbles/twig-web-framework","last_synced_at":"2025-03-12T21:21:37.297Z","repository":{"id":65709447,"uuid":"595957498","full_name":"FrewtyPebbles/Twig-Web-Framework","owner":"FrewtyPebbles","description":"A tiny web framework that utilizes the python standard library socket module to handle HTTP requests.","archived":false,"fork":false,"pushed_at":"2024-06-12T22:25:57.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-19T22:35:31.604Z","etag":null,"topics":["decorator","framework","minimal","python","tiny","twig","web"],"latest_commit_sha":null,"homepage":"","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/FrewtyPebbles.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-01T06:45:00.000Z","updated_at":"2024-06-12T22:25:59.000Z","dependencies_parsed_at":"2024-06-13T04:10:36.628Z","dependency_job_id":null,"html_url":"https://github.com/FrewtyPebbles/Twig-Web-Framework","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.21052631578947367","last_synced_commit":"42103dac0de18c123bf46765da06188499d1868b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrewtyPebbles%2FTwig-Web-Framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrewtyPebbles%2FTwig-Web-Framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrewtyPebbles%2FTwig-Web-Framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrewtyPebbles%2FTwig-Web-Framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FrewtyPebbles","download_url":"https://codeload.github.com/FrewtyPebbles/Twig-Web-Framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243294929,"owners_count":20268308,"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":["decorator","framework","minimal","python","tiny","twig","web"],"created_at":"2025-01-19T13:56:41.878Z","updated_at":"2025-03-12T21:21:37.245Z","avatar_url":"https://github.com/FrewtyPebbles.png","language":"Python","readme":"# Twig 0.5.0\n\nTwig is a backend web framework for python utilizing the **socket** module to handle http requests and serve responses.\n\n***IMPORTANT***\n\u003e This framework is something I made to use myself as a tool and is not recommended for production.\n\nTo install use the following command:\n```cli\npy -m pip install TwigWeb\n```\n\n### Changelog\n\n---\n\n**0.5.0**\n\n - Fixed dynamic router.\n\n - Implemented URL query parameters.\n\n - Implemented Headers class to separate parts of incoming request for the developer.\n\n---\n\n**0.4.0**\n\n - Added dynamic route parameters.\n\n - Improved route handling with Route class\n\n---\n\n**0.3.0**\n\n - Added static paths and folders functions.\n\n - Added element class.\n\n - Added component classes.\n\n---\n\n**0.2.0**\n\n - Added `set_all_routes` function\n\n - Fixed inconsistent request handling\n\n - Improved documentation\n\n---\n\n### Example\n\nThis example does not show all of the functionality of Twig.  There is documentation currently being worked on.\n\n```py\nfrom src.TwigWeb.backend.routehandler.route import Route, RouteParameter, RouteParamType\nfrom src.TwigWeb.backend import Server\nfrom src.TwigWeb.backend.response import Response\n\napp = Server(\"\", debug=True, open_root=False)\n\n@app.route(\"\")\ndef index(headers):\n    #this is the index of the app\n    return Response(\"test\", ContentType.html)\n\n@app.route(\"form\")\ndef form(headers):\n    #this form redirects to page/2\n    return Response(\"\"\"\u003cform action=\"/page/2\"\u003e\n\u003clabel for=\"fname\"\u003eFirst name:\u003c/label\u003e\u003cbr\u003e\n\u003cinput type=\"text\" id=\"fname\" name=\"fname\" value=\"John\"\u003e\u003cbr\u003e\n\u003clabel for=\"lname\"\u003eLast name:\u003c/label\u003e\u003cbr\u003e\n\u003cinput type=\"text\" id=\"lname\" name=\"lname\" value=\"Doe\"\u003e\u003cbr\u003e\u003cbr\u003e\n\u003cinput type=\"submit\" value=\"Submit\"\u003e\n\u003c/form\u003e\"\"\")\n\n@app.route(\"page/[num]\")\ndef index(headers, num):\n    # Headers.URL is a dictionary containing all url query parameters/variables.\n    # num a dynamic route.\n    return Response(f\"num: {num} and {headers.URL}\", ContentType.html)\n\n@app.route(\"page\")\ndef index(headers):\n    return Response(f\"page\", ContentType.html)\n\napp.run()\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrewtypebbles%2Ftwig-web-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrewtypebbles%2Ftwig-web-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrewtypebbles%2Ftwig-web-framework/lists"}