{"id":13500326,"url":"https://github.com/pythononwheels/pow_devel","last_synced_at":"2025-03-29T05:33:49.355Z","repository":{"id":12114922,"uuid":"4700260","full_name":"pythononwheels/pow_devel","owner":"pythononwheels","description":"development repo for PyhtonOnWheels framework","archived":false,"fork":false,"pushed_at":"2024-09-12T14:17:10.000Z","size":8405,"stargazers_count":75,"open_issues_count":10,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-09-13T02:18:42.537Z","etag":null,"topics":["cerberus-schemas","framework","mongodb","nosql","pyhton3","python","sqlalchemy","tinydb","tornado-webserver","web"],"latest_commit_sha":null,"homepage":"www.pythononwheels.org","language":"CSS","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/pythononwheels.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2012-06-18T11:43:54.000Z","updated_at":"2024-09-12T14:05:46.000Z","dependencies_parsed_at":"2024-09-11T22:22:29.746Z","dependency_job_id":"11fdb055-0dd0-4db4-b6c1-1ab15ae21e04","html_url":"https://github.com/pythononwheels/pow_devel","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythononwheels%2Fpow_devel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythononwheels%2Fpow_devel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythononwheels%2Fpow_devel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythononwheels%2Fpow_devel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pythononwheels","download_url":"https://codeload.github.com/pythononwheels/pow_devel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222466028,"owners_count":16989129,"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":["cerberus-schemas","framework","mongodb","nosql","pyhton3","python","sqlalchemy","tinydb","tornado-webserver","web"],"created_at":"2024-07-31T22:00:56.318Z","updated_at":"2024-10-31T18:32:11.818Z","avatar_url":"https://github.com/pythononwheels.png","language":"CSS","readme":"\n![Pow logo](http://www.pythononwheels.org/static/images/pow_logo_300.png)\n\n# Just do your thing!\n\n\u003e A python web framework, build on the Ruby on Rails principles. \n\n Generators for models, controllers, scaffolding views and database migrations. Validation, convention over configuration..and much more. Focus on your thing instead of the boilerplate.\n\n# Hello World\n~~~~\n@app.make_routes()\nclass HelloHandler(BaseHandler):\n    @route(r'/hello', dispatch=[\"get\"])\n    def hello(self):\n        self.write(\"Hello world!\")\n~~~~\n\n## Installation:\n\n`pip install -U pythononwheels`\n\n# Everything you need on board. Batteries included.\n[PythonOnWheels](https://www.pythononwheels.org/) is a generative, Rapid Application Development, non intrusive web framework for python. You need no extra tools to start. Everything from DB to Webserver and template engine is included. But you are not forced to use them and can go raw or easily include the modules and tools of your choice tools whenever you want.\n\n# Based on a very Strong foundation:\n* python 3.x\n* [tornado](http://www.tornadoweb.org/en/stable/) webserver\n* Supported SQL Databases\n* SQL: [sqlalchemy](https://www.sqlalchemy.org/) ORM (SQLite, MySQL, PostgreSQL, MS-SQL, Oracle, and more ..)\n* Database Migrations onboard (based on alembic) generated behind the scenes\n* NoSQL: [tinyDB](https://tinydb.readthedocs.io/en/latest/index.html), [MongoDB](https://www.mongodb.com/), [elasticsearch](https://www.elastic.co/products/elasticsearch)\n* [cerberus](http://docs.python-cerberus.org/en/stable/) schemas and validation on board\n* tornado templates\n* css Frameworks: [bootstrap4](https://getbootstrap.com/) and [semanticUI](https://semantic-ui.com/)\n\n# Probably the most simple SQL relations out there! \nBased on sqlalchemy.\nWith PythonOnWheels you simply add a class decorator like \n\n~~~~\n@relation.has_many(\"comments\")\nclass Post(Base):\n    # All your Post model code below here ..\n    .....\n~~~~\n\nto your SQL Post-model and every Post can have comments. It will be automatically mapped to the DB (SQLite, Postgres, MySQL, MariaDb, Oracle, MSSQL ...) and to all related comment Models. DB Migrations are created automatically in the background.\n\n## supported relation types are:\n\n* has_many(\"comments\")(decorated class has many comments.)\n* many_to_many(\"comments\")(decorated class has many to many with comments)\n* belongs_to(\"comments\")(decorated class belongs to comments.)\n* one_to_one(\"comments\")(decorated class has one to one with comments)\n* tree() (decorated class has adjacence list (is a tree)\n\n# All pow models (SQL or NoSQL) use a [cerberus](http://docs.python-cerberus.org/en/stable/) schema as definition. \n## This means you have validation on board for every model and you can easily switch from SQL to NoSQL\n\n* the @relation.setup_schema() decorator will map this schema to a vaild sqlalchemy (or specific NoSQL) column definition set.\n* SQL only: model will also automatically get all the right Foreign_Keys and python attributes to create a has_many relationship to the comments model. This is all done for you with the @relation.has_many(\"comments\")\n@relation.has_many(\"comments\")\n@relation.setup_schema()\n\n~~~~\nclass Post(Base):\n#\n# Schema definition with the new (cerberus) schema style\n# which offer you immediate validation\n#\nschema = {\n    # string sqltypes can be TEXT or UNICODE or nothing\n    'author': {'type': 'string', 'maxlength' : 35 },\n    'title' : {'type': 'string', \"required\" : True },\n    'text'  : {'type': 'string' },\n    'votes' : {'type': 'integer' },\n    'status': {'type': 'string', \"allowed\" : [\"backlog\", \"wip\", \"done\"] },\n}\n\n# init\ndef __init__(self, **kwargs):\n    self.init_on_load(**kwargs)\n\n# your methods down here\n~~~~\n\n# Probably the most simple RESTrouting out there! One decorator. Done!\n## With PythonOnWheels you simply add a class decorator like \n~~~~\n@app.add_rest_routes(\"basename\") \n~~~~\nto your handler and you get all the typical REST routes mapped to the according CRUD methods of your handler class.\n\n## By the way: this is what generate_handler generates for you when you use the --rest parameter:\n~~~~\n@app.add_rest_routes(\"rest_test\")\nclass RestTest(BaseHandler):\n    # \n    # every pow handler automatically gets these RESTful routes\n    # when you add the : app.add_rest_routes() decorator.\n    #\n    # 1  GET    /resttest                           #=\u003e list\n    # 2  GET    /resttest/\u003cuuid:identifier\u003e         #=\u003e show\n    # 3  GET    /resttest/new                       #=\u003e new\n    # 4  GET    /resttest/\u003cuuid:identifier\u003e/edit    #=\u003e edit \n    # 5  GET    /resttest/page/\u003cuuid:identifier\u003e    #=\u003e page\n    # 6  GET    /resttest/search                    #=\u003e search\n    # 7  PUT    /resttest/\u003cuuid:identifier\u003e         #=\u003e update\n    # 8  PUT    /resttest                           #=\u003e update (You have to send the id as json payload)\n    # 9  POST   /resttest                           #=\u003e create\n    # 10 DELETE /resttest/\u003cuuid:identifier\u003e         #=\u003e destroy\n    # ...\n~~~~\n\n# Routing: RegEx and Flask like routes included . \nYou can set routes by simply adding a class decorator to the handler class or decorate methods directly.\n~~~~\n@route(\"/\", dispatch=[\"get\"])\n~~~~\n\nPythonOnWheels will then call the index method of your handler if the route and the HTTP method matches.\n\n## Example for Flask like routing:\n~~~~\n@app.make_method_routes()\nclass HelloHandler(BaseHandler):\n    @route(r'/hello/\u003cint:identifier\u003e', dispatch=[\"get\"])\n    def hello(self, identifier=None):\n        self.write(\"Hello world! \" + str(identifier))\n~~~~\n## For Regex routes:\n~~~~\n@app.add_route(\"/test/([0-9]+)*\", dispatch={\"get\" : \"test\"})\n~~~~\nto add a direct route: matching the regular expression : /test/([0-9+]) and then calling the given method of your handler class. The regex group ([0-9+]) will be handed as the first parameter to test(self, index)\n\n# Model Validation on board with cerberus schemas. \nAll Model Schemas are Cerberus schemas automatically.\nSo thats easy. \n~~~~\n    model.validate() =\u003e executes cerberus validator\n~~~~\n\nAnd finally: a super easy workflow. \nQuick to start, all the basics on board and easy to expand:\ngenerative approach (but not noisy)\n\n* generate_app script\n* generate_models script (You probably want to store some data)\n* Optionally generate_migrations script (only needed for SQL DBs)\n* generate_handlers (aka controllers to define your logic and API)\n* start the server (python server.py) done\n\n# The vision:\n\u003eIf you want start to develop your web-application and focus on the App, instead of the frameworks, you are in the right place. PythonOnWheels feels right if you do not recognize that you use it.\n\u003e\n\n# Enjoy! \nSee [getting started](http://www.pythononwheels.org/article/7de74cc6-8af2-45ac-b619-eea61e4da44f) or go to the [documentation](http://www.pythononwheels.org/article/2160fdfd-fc9f-4380-aeb3-bc13d2c201e0)\n\n\n## For more check: [The PythonOnWheels Homepage](http://www.pythononwheels.org)\n\n\n    ","funding_links":[],"categories":["CSS"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythononwheels%2Fpow_devel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythononwheels%2Fpow_devel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythononwheels%2Fpow_devel/lists"}