.. figure:: http://www.pythononwheels.org/static/images/pow_logo_300.png
:alt: Pow logo
Pow logo
The quick and easy generative Webframework for python3. Ready to go!
====================================================================
Based on the ruby on rails principles. Generators for
models/controllers/views/migrations..., convention over
configuration, and PoW gets out of the way if you want it.
Hello World
===========
::
@app.make_routes()
class HelloHandler(BaseHandler):
@route(r'/hello', dispatch=["get"])
def hello(self):
self.write("Hello world!")
Installation:
-------------
``pip install -U pythononwheels``
Everything you need on board. Batteries included.
=================================================
`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.
Based on a very Strong foundation:
==================================
- python 3.x
- `tornado <http://www.tornadoweb.org/en/stable/>`__ webserver
- Supported SQL Databases
- SQL: `sqlalchemy <https://www.sqlalchemy.org/>`__ ORM (SQLite, MySQL,
PostgreSQL, MS-SQL, Oracle, and more ..)
- Database Migrations onboard (based on alembic) generated behind the
scenes
- NoSQL:
`tinyDB <https://tinydb.readthedocs.io/en/latest/index.html>`__,
`MongoDB <https://www.mongodb.com/>`__,
`elasticsearch <https://www.elastic.co/products/elasticsearch>`__
- `cerberus <http://docs.python-cerberus.org/en/stable/>`__ schemas and
validation on board
- tornado templates
- css Frameworks: `bootstrap4 <https://getbootstrap.com/>`__ and
`semanticUI <https://semantic-ui.com/>`__
Probably the most simple SQL relations out there!
=================================================
Based on sqlalchemy. With PythonOnWheels you simply add a class
decorator like
::
@relation.has_many("comments")
class Post(Base):
# All your Post model code below here ..
.....
to 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.
supported relation types are:
-----------------------------
- has\_many("comments")(decorated class has many comments.)
- many\_to\_many("comments")(decorated class has many to many with
comments)
- belongs\_to("comments")(decorated class belongs to comments.)
- one\_to\_one("comments")(decorated class has one to one with
comments)
- tree() (decorated class has adjacence list (is a tree)
All pow models (SQL or NoSQL) use a `cerberus <http://docs.python-cerberus.org/en/stable/>`__ schema as definition.
===================================================================================================================
This means you have validation on board for every model and you can easily switch from SQL to NoSQL
---------------------------------------------------------------------------------------------------
- the @relation.setup\_schema() decorator will map this schema to a
vaild sqlalchemy (or specific NoSQL) column definition set.
- 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") @relation.has\_many("comments")
@relation.setup\_schema()
::
class Post(Base):
#
# Schema definition with the new (cerberus) schema style
# which offer you immediate validation
#
schema = {
# string sqltypes can be TEXT or UNICODE or nothing
'author': {'type': 'string', 'maxlength' : 35 },
'title' : {'type': 'string', "required" : True },
'text' : {'type': 'string' },
'votes' : {'type': 'integer' },
'status': {'type': 'string', "allowed" : ["backlog", "wip", "done"] },
}
# init
def __init__(self, **kwargs):
self.init_on_load(**kwargs)
# your methods down here
Probably the most simple RESTrouting out there! One decorator. Done!
====================================================================
With PythonOnWheels you simply add a class decorator like
---------------------------------------------------------
::
@app.add_rest_routes("basename")
to your handler and you get all the typical REST routes mapped to the
according CRUD methods of your handler class.
By the way: this is what generate\_handler generates for you when you use the --rest parameter:
-----------------------------------------------------------------------------------------------
::
@app.add_rest_routes("rest_test")
class RestTest(BaseHandler):
#
# every pow handler automatically gets these RESTful routes
# when you add the : app.add_rest_routes() decorator.
#
# 1 GET /resttest #=> list
# 2 GET /resttest/<uuid:identifier> #=> show
# 3 GET /resttest/new #=> new
# 4 GET /resttest/<uuid:identifier>/edit #=> edit
# 5 GET /resttest/page/<uuid:identifier> #=> page
# 6 GET /resttest/search #=> search
# 7 PUT /resttest/<uuid:identifier> #=> update
# 8 PUT /resttest #=> update (You have to send the id as json payload)
# 9 POST /resttest #=> create
# 10 DELETE /resttest/<uuid:identifier> #=> destroy
# ...
Routing: RegEx and Flask like routes included .
===============================================
You can set routes by simply adding a class decorator to the handler
class or decorate methods directly. ~\ :sub:`~` @route("/",
dispatch=["get"]) ~\ :sub:`~`
PythonOnWheels will then call the index method of your handler if the
route and the HTTP method matches.
Example for Flask like routing:
-------------------------------
::
@app.make_method_routes()
class HelloHandler(BaseHandler):
@route(r'/hello/<int:identifier>', dispatch=["get"])
def hello(self, identifier=None):
self.write("Hello world! " + str(identifier))
For Regex routes:
-----------------
::
@app.add_route("/test/([0-9]+)*", dispatch={"get" : "test"})
to 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)
Model Validation on board with cerberus schemas.
================================================
All Model Schemas are Cerberus schemas automatically. So thats easy.
~\ :sub:`~` model.validate() => executes cerberus validator ~\ :sub:`~`
And finally: a super easy workflow. Quick to start, all the basics on
board and easy to expand: generative approach (but not noisy)
- generate\_app script
- generate\_models script (You probably want to store some data)
- Optionally generate\_migrations script (only needed for SQL DBs)
- generate\_handlers (aka controllers to define your logic and API)
- start the server (python server.py) done
The vision:
===========
If 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.
Enjoy!
======
See `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>`__
For more check: `The PythonOnWheels Homepage <http://www.pythononwheels.org>`__
-------------------------------------------------------------------------------
Raw data
{
"_id": null,
"home_page": "http://www.pythononwheels.org",
"name": "pythononwheels",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "framework web development",
"author": "khz",
"author_email": "khz@tzi.org",
"download_url": "https://files.pythonhosted.org/packages/04/39/70cbe10d3b3113e3d7da2f3339037deb1f577617666ed372716d4f4de328/pythononwheels-0.925.54.tar.gz",
"platform": null,
"description": ".. figure:: http://www.pythononwheels.org/static/images/pow_logo_300.png\n :alt: Pow logo\n\n Pow logo\n\nThe quick and easy generative Webframework for python3. Ready to go!\n====================================================================\n\n Based on the ruby on rails principles. Generators for\n models/controllers/views/migrations..., convention over\n configuration, and PoW gets out of the way if you want it.\n\nHello World\n===========\n\n::\n\n @app.make_routes()\n class HelloHandler(BaseHandler):\n @route(r'/hello', dispatch=[\"get\"])\n def hello(self):\n self.write(\"Hello world!\")\n\nInstallation:\n-------------\n\n``pip install -U pythononwheels``\n\nEverything you need on board. Batteries included.\n=================================================\n\n`PythonOnWheels <https://www.pythononwheels.org/>`__ is a generative,\nRapid Application Development, non intrusive web framework for python.\nYou need no extra tools to start. Everything from DB to Webserver and\ntemplate engine is included. But you are not forced to use them and can\ngo raw or easily include the modules and tools of your choice tools\nwhenever you want.\n\nBased on a very Strong foundation:\n==================================\n\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,\n PostgreSQL, MS-SQL, Oracle, and more ..)\n- Database Migrations onboard (based on alembic) generated behind the\n scenes\n- NoSQL:\n `tinyDB <https://tinydb.readthedocs.io/en/latest/index.html>`__,\n `MongoDB <https://www.mongodb.com/>`__,\n `elasticsearch <https://www.elastic.co/products/elasticsearch>`__\n- `cerberus <http://docs.python-cerberus.org/en/stable/>`__ schemas and\n validation on board\n- tornado templates\n- css Frameworks: `bootstrap4 <https://getbootstrap.com/>`__ and\n `semanticUI <https://semantic-ui.com/>`__\n\nProbably the most simple SQL relations out there!\n=================================================\n\nBased on sqlalchemy. With PythonOnWheels you simply add a class\ndecorator like\n\n::\n\n @relation.has_many(\"comments\")\n class Post(Base):\n # All your Post model code below here ..\n .....\n\nto your SQL Post-model and every Post can have comments. It will be\nautomatically mapped to the DB (SQLite, Postgres, MySQL, MariaDb,\nOracle, MSSQL ...) and to all related comment Models. DB Migrations are\ncreated automatically in the background.\n\nsupported relation types are:\n-----------------------------\n\n- has\\_many(\"comments\")(decorated class has many comments.)\n- many\\_to\\_many(\"comments\")(decorated class has many to many with\n comments)\n- belongs\\_to(\"comments\")(decorated class belongs to comments.)\n- one\\_to\\_one(\"comments\")(decorated class has one to one with\n comments)\n- tree() (decorated class has adjacence list (is a tree)\n\nAll pow models (SQL or NoSQL) use a `cerberus <http://docs.python-cerberus.org/en/stable/>`__ schema as definition.\n===================================================================================================================\n\nThis means you have validation on board for every model and you can easily switch from SQL to NoSQL\n---------------------------------------------------------------------------------------------------\n\n- the @relation.setup\\_schema() decorator will map this schema to a\n vaild sqlalchemy (or specific NoSQL) column definition set.\n- SQL only: model will also automatically get all the right\n Foreign\\_Keys and python attributes to create a has\\_many\n relationship to the comments model. This is all done for you with the\n @relation.has\\_many(\"comments\") @relation.has\\_many(\"comments\")\n @relation.setup\\_schema()\n\n::\n\n class Post(Base):\n #\n # Schema definition with the new (cerberus) schema style\n # which offer you immediate validation\n #\n schema = {\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\n def __init__(self, **kwargs):\n self.init_on_load(**kwargs)\n\n # your methods down here\n\nProbably the most simple RESTrouting out there! One decorator. Done!\n====================================================================\n\nWith PythonOnWheels you simply add a class decorator like\n---------------------------------------------------------\n\n::\n\n @app.add_rest_routes(\"basename\") \n\nto your handler and you get all the typical REST routes mapped to the\naccording CRUD methods of your handler class.\n\nBy the way: this is what generate\\_handler generates for you when you use the --rest parameter:\n-----------------------------------------------------------------------------------------------\n\n::\n\n @app.add_rest_routes(\"rest_test\")\n class 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 #=> list\n # 2 GET /resttest/<uuid:identifier> #=> show\n # 3 GET /resttest/new #=> new\n # 4 GET /resttest/<uuid:identifier>/edit #=> edit \n # 5 GET /resttest/page/<uuid:identifier> #=> page\n # 6 GET /resttest/search #=> search\n # 7 PUT /resttest/<uuid:identifier> #=> update\n # 8 PUT /resttest #=> update (You have to send the id as json payload)\n # 9 POST /resttest #=> create\n # 10 DELETE /resttest/<uuid:identifier> #=> destroy\n # ...\n\nRouting: RegEx and Flask like routes included .\n===============================================\n\nYou can set routes by simply adding a class decorator to the handler\nclass or decorate methods directly. ~\\ :sub:`~` @route(\"/\",\ndispatch=[\"get\"]) ~\\ :sub:`~`\n\nPythonOnWheels will then call the index method of your handler if the\nroute and the HTTP method matches.\n\nExample for Flask like routing:\n-------------------------------\n\n::\n\n @app.make_method_routes()\n class HelloHandler(BaseHandler):\n @route(r'/hello/<int:identifier>', dispatch=[\"get\"])\n def hello(self, identifier=None):\n self.write(\"Hello world! \" + str(identifier))\n\nFor Regex routes:\n-----------------\n\n::\n\n @app.add_route(\"/test/([0-9]+)*\", dispatch={\"get\" : \"test\"})\n\nto add a direct route: matching the regular expression : /test/([0-9+])\nand then calling the given method of your handler class. The regex group\n([0-9+]) will be handed as the first parameter to test(self, index)\n\nModel Validation on board with cerberus schemas.\n================================================\n\nAll Model Schemas are Cerberus schemas automatically. So thats easy.\n~\\ :sub:`~` model.validate() => executes cerberus validator ~\\ :sub:`~`\n\nAnd finally: a super easy workflow. Quick to start, all the basics on\nboard and easy to expand: generative 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\nThe vision:\n===========\n\n If you want start to develop your web-application and focus on the\n App, instead of the frameworks, you are in the right place.\n PythonOnWheels feels right if you do not recognize that you use it.\n\nEnjoy!\n======\n\nSee `getting\nstarted <http://www.pythononwheels.org/article/7de74cc6-8af2-45ac-b619-eea61e4da44f>`__\nor go to the\n`documentation <http://www.pythononwheels.org/article/2160fdfd-fc9f-4380-aeb3-bc13d2c201e0>`__\n\n\nFor more check: `The PythonOnWheels Homepage <http://www.pythononwheels.org>`__\n-------------------------------------------------------------------------------\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The simple, quick and easy generative web framework for python",
"version": "0.925.54",
"project_urls": {
"Homepage": "http://www.pythononwheels.org"
},
"split_keywords": [
"framework",
"web",
"development"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ce9090ba5e3f31c9b2bfcd96038426c4182741bb4c38868f16705d2c332d406f",
"md5": "ca780efb75ef96cb6215e941876c1c84",
"sha256": "3cf804686dee7daebaa53ae459e500b7c936ee2857b73914a25c4d2c783aab8e"
},
"downloads": -1,
"filename": "pythononwheels-0.925.54-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ca780efb75ef96cb6215e941876c1c84",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4838178,
"upload_time": "2024-09-11T15:33:13",
"upload_time_iso_8601": "2024-09-11T15:33:13.478903Z",
"url": "https://files.pythonhosted.org/packages/ce/90/90ba5e3f31c9b2bfcd96038426c4182741bb4c38868f16705d2c332d406f/pythononwheels-0.925.54-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "043970cbe10d3b3113e3d7da2f3339037deb1f577617666ed372716d4f4de328",
"md5": "fc33a5b1350b184cd1e2ff7b2078c91e",
"sha256": "c43f58fb784016a9a03b46787a7ec13949d716a34f87331725aec649dc095874"
},
"downloads": -1,
"filename": "pythononwheels-0.925.54.tar.gz",
"has_sig": false,
"md5_digest": "fc33a5b1350b184cd1e2ff7b2078c91e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4672306,
"upload_time": "2024-09-11T15:33:16",
"upload_time_iso_8601": "2024-09-11T15:33:16.537906Z",
"url": "https://files.pythonhosted.org/packages/04/39/70cbe10d3b3113e3d7da2f3339037deb1f577617666ed372716d4f4de328/pythononwheels-0.925.54.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-11 15:33:16",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pythononwheels"
}