{"id":20021325,"url":"https://github.com/pallets-eco/flask-classful","last_synced_at":"2025-05-15T02:08:30.593Z","repository":{"id":36052090,"uuid":"40349984","full_name":"pallets-eco/flask-classful","owner":"pallets-eco","description":"Class based views for Flask","archived":false,"fork":false,"pushed_at":"2025-03-06T03:34:33.000Z","size":994,"stargazers_count":233,"open_issues_count":7,"forks_count":54,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-05-09T05:15:41.322Z","etag":null,"topics":["flask","python"],"latest_commit_sha":null,"homepage":"https://flask-classful.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"apiguy/flask-classy","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pallets-eco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2015-08-07T08:30:10.000Z","updated_at":"2025-02-23T09:01:16.000Z","dependencies_parsed_at":"2023-10-03T13:46:59.836Z","dependency_job_id":"2a3201f8-e59d-4a84-ae96-342059c72763","html_url":"https://github.com/pallets-eco/flask-classful","commit_stats":null,"previous_names":["teracyhq/flask-classful"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-classful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-classful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-classful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-classful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pallets-eco","download_url":"https://codeload.github.com/pallets-eco/flask-classful/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253869325,"owners_count":21976605,"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":["flask","python"],"created_at":"2024-11-13T08:36:20.113Z","updated_at":"2025-05-15T02:08:30.561Z","avatar_url":"https://github.com/pallets-eco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Flask-Classful\n==============\n\nFlask-Classful is an extension that adds class-based views to [Flask][].\nClass-based views are a way to encapsulate specific context and behavior for\nroutes and methods, complementing Flask's blueprints. They provide a more\npowerful system than Flask's own `MethodView`.\n\nRead the documentation at \u003chttps://flask-classful.readthedocs.io\u003e.\n\n[Flask]: https://flask.palletsprojects.com\n\n\nPallets Community Ecosystem\n---------------------------\n\n\u003e [!IMPORTANT]\\\n\u003e This project is part of the Pallets Community Ecosystem. Pallets is the\n\u003e organization that maintains Flask; Pallets-Eco enables community maintenance\n\u003e of Flask extensions. If you are interested in helping maintain this project,\n\u003e please reach out on [the Pallets Discord server](https://discord.gg/pallets).\n\n\nA Basic Example\n---------------\n\nThis example defines a few routes by defining methods on a subclass of\n`flask_classful.FlaskView`.\n\n```python\n# example.py\nimport random\nfrom flask import Flask, abort\nfrom flask_classful import FlaskView\n\nquotes = [\n    \"A noble spirit embiggens the smallest man! ~ Jebediah Springfield\",\n    \"If there is a way to do it better... find it. ~ Thomas Edison\",\n    \"No one knows what he can do till he tries. ~ Publilius Syrus\"\n]\n\napp = Flask(__name__)\n\nclass QuotesView(FlaskView):\n    def index(self):\n        return \"\u003cbr\u003e\".join(quotes)\n\n    def get(self, id):\n        id = int(id)\n\n        if id \u003c len(quotes):\n            return quotes[id]\n\n        abort(404)\n\n    def random(self):\n        return random.choice(quotes)\n\nQuotesView.register(app)\n```\n\n```\n$ flask -A example run --debug\n```\n\n-   http://127.0.0.1:5000/quotes/ shows all the quotes.\n-   http://127.0.0.1:5000/quotes/1/ shows a single quote.\n-   http://127.0.0.1:5000/quotes/random/ shows a random quote.\n\n\nForked from Flask-Classy\n------------------------\n\n\u003e [!NOTE]\\\n\u003e This is a fork of Flask-Classy to continue development after it was not\n\u003e updated for a long time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallets-eco%2Fflask-classful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpallets-eco%2Fflask-classful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallets-eco%2Fflask-classful/lists"}