The simple, quick and easy generative web framework for python
Project description
PythonOnWheels reStructured and reImplemented.
I call it SQUEEZY => for Simple, Quick and Easy.
Principle
> Designed for simplicity, happiness and Quick results!
As simple to use as possible. Everything you always need on board. Batteries included! (tornado Webserver, SQLite DB, NoSQL DBs: tinyDB, MongoDB, MongoDB Atlas Service) Non intrusive! You can always escape and go RAW.
Newly implemented:
MongoDB support (Transactions usable with Mongo >4)
MongoDB Atlas support for even quicker start in the cloud
Observer for Models (Like ActiveRedcord. Just add a class Named: ModelNameObserver. Will be found and used by convention)
Added Dirty Model support (like ActiveRecord). Track changes, Show, rollback.
Strong Foundation:
python 3.x
tornado webserver
sqlalchemy ORM onboard (sqlite, mysql, postgres, oralce, ms-sql …)
DB migrations generated for you (based on alembic)
cerberus schemas and validation on board
template engine (tornado templates)
Many SQL DBs[sqlite, mysql, postgres, ms-sql,orcale ] NoSql DBs: tinyDB, MongoDB and ElasticSearch on board…
authentication with Twitter, Google on board
Super easy, quick to start and all the basics on board:
super easy relations with decorators @relations.has_many(“comments”)
super easy REST routing with decorators @app.add_restful_routes(),
routing decorator @app.add_route(route)
db migrations autogenerated using alembic in the back
validation on board with cerberus schemas
use the same schema descrition for all model types (sql, nosql, elastic..)
generate_models script
generate_migrations script
update_db script
generate_handlers
generate_app
automatic scaffolding views (work in progress)
Code examples
Routes:
# You can use regex routes # this will call the myget method on HTTP GET calls and will hand over the re-group as the 1st parameter. @app.add_route("/index/([0-9]+)*", dispatch={"get" : "myget"}) # Or you can also use Flask/Werkzeug routes @app.add_route('/index/<int:year>', dispatch={"get" : "myyear"}) class IndexdHandler(BaseHandler): def myget(self, index=None): print(" index:" + str(index)) self.render("index.tmpl") def myyear(self, year=None): self.write("I got year: " + str(year))
Relations: (SQL Models)
@relation.has_many("comments") class Post(Base): # a blog Post schema = { 'text' : {'type': 'string'}, 'name' : {'type': 'string', 'maxlength' : 35}, 'votes' : {'type': 'integer'}, 'status' : {'type': 'string', 'allowed' : ['ready to publish', 'needs review', 'draft'] }, 'published' : {'type': 'boolean', 'default' : False } }
NoSQL Models
class Post(Base): # a blog Post schema = { 'text' : {'type': 'string'}, 'name' : {'type': 'string', 'maxlength' : 35}, 'votes' : {'type': 'integer'}, 'status' : {'type': 'string', 'allowed' : ['ready to publish', 'needs review', 'draft'] }, 'published' : {'type': 'boolean', 'default' : False }, 'tags' : {'type': 'list', 'default' : [] } }
Hope you see that SQL and NoSQL are pretty much the same. No need for relations in NoSQL. But you have enhanced datatypes like lists and dicts in NoSQL. A NoSql List can be mapped to a SQL @relation.has_many() ….
Enjoy!
Check: The PythonOnWheels Homepage
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pythononwheels-0.852b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50be73de346144a6782ee9317c7be45af3e30c24369ddb2bc35ddf347126eeca |
|
MD5 | d5bb0b993ff319053ad9aebc3f0a4bfa |
|
BLAKE2b-256 | 65155946fe2b7705461a1244f6f096d8764c897f103aedc469428e0494840833 |