{"id":22731781,"url":"https://github.com/fenhl/flask-view-tree","last_synced_at":"2026-05-18T10:35:50.902Z","repository":{"id":148504031,"uuid":"148549765","full_name":"fenhl/flask-view-tree","owner":"fenhl","description":"Hierarchically structuring webpages in Flask made easy","archived":false,"fork":false,"pushed_at":"2020-01-19T11:08:47.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T07:14:11.564Z","etag":null,"topics":["flask","python-library","python3"],"latest_commit_sha":null,"homepage":null,"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/fenhl.png","metadata":{"files":{"readme":"README.md","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":"2018-09-12T22:27:51.000Z","updated_at":"2022-10-02T16:19:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"d19a00b4-e46a-42a8-b4d3-6afe49f98149","html_url":"https://github.com/fenhl/flask-view-tree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fenhl/flask-view-tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenhl%2Fflask-view-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenhl%2Fflask-view-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenhl%2Fflask-view-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenhl%2Fflask-view-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fenhl","download_url":"https://codeload.github.com/fenhl/flask-view-tree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenhl%2Fflask-view-tree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33174949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["flask","python-library","python3"],"created_at":"2024-12-10T19:30:40.815Z","updated_at":"2026-05-18T10:35:50.884Z","avatar_url":"https://github.com/fenhl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**flask-view-tree** is a utility for hierarchically structuring webpages in [Flask](http://flask.pocoo.org/).\n\n# Dependencies\n\n* Python 3.5\n* [class_key](https://github.com/fenhl/python-class-key)\n* [more_itertools](https://pypi.org/project/more-itertools/)\n\n# Example\n\n```python\nimport flask\nimport flask_view_tree\n\nimport my_app.model\n\napp = application = flask.Flask(...)\n\n@flask_view_tree.index(app) # The entry point to the flask_view_tree API. Registers this view function for `/`.\ndef index():\n    return flask.render_template('index.html')\n\n@index.child('users') # Registers this view function for `/users`.\ndef users_list():\n    return flask.render_template('users-list.html')\n\n@users_list.children(my_app.model.User) # Registers this view function for `/users/\u003cuser\u003e`.\ndef profile(user):\n    return flask.render_template('profile.html', user=user) # `user` will be the result of calling `my_app.model.User` with the given URL fragment.\n\n@index.redirect('me') # Redirects `/me` to `/users/\u003cflask.g.user\u003e`, and all URLs starting with `/me/` to `/users/\u003cflask.g.user\u003e/`.\ndef me():\n    return profile, flask.g.user\n```\n\n**Note:** A node can either have any number of children registered using `child`, or have all children handled by a single registration of `children`. Do not mix `child` and `children`, or call `children` multiple times on the same node, unless you're sure you know what you're doing.\n\nA view function decorated using `children` has a `viewfunc.catch_init` property which can decorate an exception handler. This handler will be called if converting the variable fails and one of the given exception types is raised, passing the caught exception as well as the raw argument value. It can be used multiple times to handle different kinds of exceptions differently.\n\n```python\n@profile.catch_init(KeyError, FileNotFoundError)\ndef profile_catch_init(exc, value):\n    return flask.render_template('user_not_found.html', username=value), 404\n\n@profile.catch_init(ValueError)\ndef profile_catch_init(exc, value):\n    return flask.render_template('invalid_username.html', username=value), 404\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenhl%2Fflask-view-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffenhl%2Fflask-view-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenhl%2Fflask-view-tree/lists"}