Data loader for SQLAlchemy
clue_sqlaloader was primarily meant to run from inside other applications as a framework piece but can be run from the command-line as follows:
$ python -m clue_sqlaloader.__init__ sqlite:///somefile.db data.yaml
The typical way to use the loader from within Python is as follows:
from clue_sqlaloader import Loader loader = Loader(sqlalchemy_session) loader.load_from_yamlf('somefile.yaml')
The format of the YAML should be similar to the following:
- model: mymodule.Group refname: !!refname "admingroup" fields: name: admin - model: mymodule.User fields: username: testuser1 email: email@example.com groups: [!!ref "admingroup"] execute: set_password: testuser1
The model and fields arguments are straightforward. The execute argument will call the given function name on the newly created object with the given value.
Written and maintained by Rocky Burt <rocky AT serverzen DOT com>
- Made Reference lookup a little more robust
- Added missing dep for zope.dottedname
- first release
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size clue_sqlaloader-0.1.1.tar.gz (4.1 kB)||File type Source||Python version None||Upload date||Hashes View hashes|