3 ms·
I haven't tried it, but the choice to include the entire application in one file is ... interesting. https://github.com/coleifer/peewee/blob/master/peewee.py h
by mpdehaan2 11y ago
I haven't tried it, but the choice to include the entire application in one file is ... interesting.
https://github.com/coleifer/peewee/blob/master/peewee.py https://github.com/coleifer/peewee/blob/master/peewee.py
- mhd 11y agoBetween that, bottle and maybe sqlite, you've got your whole setup in a directory without requiring modules, packagers etc. That can be a big boon for internal or embedded stuff, when you don't have total control over your environment.
- mpdehaan2 11y agoIf you're just looking to distribute, you could use git submodules and point at any package that way. git checkout --recursive, etc. Or just a symlink and include it in your setup.py. Or check it out inside your project. Still allows better organized code. Given, the alternatives are very metaclass heavy black magic, and sometimes spare on comments - actually nearly all ORMs are very heavy on the black magic :)
- collyw 11y agoI can't think of an example of when you would want "embedded stuff" running a webserver. Do you have any examples? (Not saying its not needed, but I am struggling to see where)
- mhd 11y agoMaybe not the apocryphal Forth washing machine controller, but components used in automation often employ web servers for remote configuration and statistics. If it isn't a PLC (although there are some devices that basically mix a small embedded RT PC with a PLC). Connect to the device via ethernet, and the device then communicates with a machine through some kind of bus. If you've got wifi/ethernet, configuration through web servers comes naturally.
- dalke 11y agoThat made it very convenient for me recently. I had a contract that did a bunch of data analysis. The last step is to upload the results into either MySQL or SQLite database. I used peewee.py, plus some code from playhouse/db_url.py, and got it working. Even without using the ORM part, the database objects have information to help me roll my own cross-database SQL calls using a bit of string substitution so "?" becomes "%s", etc.
- coleifer 11y agoA lot of folks may not know, but Peewee has a large "contrib" package full of db-specific extension modules and other neat things called `playhouse`. If you use `pip` to install peewee or clone it from GitHub, the `playhouse` modules are included. So while yes, Peewee is a single module, there are lots of extension modules that add a ton of functionality [1]. 1: http://docs.peewee-orm.com/en/latest/peewee/playhouse.html http://docs.peewee-orm.com/en/latest/peewee/playhouse.html