SQLAlchemy Seeder
Project description
sqlalchemyseed
Sqlalchemy seeder that supports nested relationships.
Supported file types
- json
- yaml
- csv
Installation
Default installation
pip install sqlalchemyseed
Quickstart
# main.py
from sqlalchemyseed import load_entities_from_json
from sqlalchemyseed import Seeder
from db import session
# load entities
entities = load_entities_from_json('data.json')
# Initializing Seeder
seeder = Seeder(session)
# Seeding
seeder.seed(entities)
# Committing
session.commit() # or seeder.session.commit()
Documentation
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
sqlalchemyseed-1.0.5.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for sqlalchemyseed-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15da1c2385561137cd290ffa3d353bab2b4c3cc9146788be2334691dbacf56dd |
|
MD5 | ee13e9a6f131a7060c1d47d93cb250b7 |
|
BLAKE2b-256 | 8d4fd76bea0a6ad00abf00b9156e0d51b53d52b9bb0f6068eaa37e51629ecf44 |