Mutable BeautifulSoup database type
Project description
SQLAlchemy-MutableSoup defines a mutable BeautifulSoup SQLAlchemy database type.
Installation
$ pip install sqlalchemy-mutablesoup
Quickstart
from sqlalchemy_mutablesoup import MutableSoupType
from sqlalchemy import Column, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
# standard session creation
engine = create_engine('sqlite:///:memory:')
session_factory = sessionmaker(bind=engine)
Session = scoped_session(session_factory)
session = Session()
Base = declarative_base()
# define and instantiate a model with a MutableSoupType column.
class Model(Base):
__tablename__ = 'model'
id = Column(Integer, primary_key=True)
soup = Column(MutableSoupType)
Base.metadata.create_all(engine)
model = Model()
session.add(model)
You can now treat model.soup
as a bs4.BeautifulSoup
object.
Citation
@software{bowen2020sqlalchemy-mutablesoup,
author = {Dillon Bowen},
title = {SQLAlchemy-MutableSoup},
url = {https://dsbowen.github.io/sqlalchemy-mutablesoup/},
date = {2020-06-04},
}
License
Users must cite this package in any publications which use it.
It is licensed with the MIT License.
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
Close
Hashes for sqlalchemy-mutablesoup-0.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92da0472a02d2523eeda6198e6e80e6c95067f251948940b744b862d11a896f4 |
|
MD5 | 2c2a0b4ca43b90cb44a37335d541a74a |
|
BLAKE2b-256 | 815dac7e7501d5b33ca261529be6367485010bf10107fe6c40c2265e38b9b6f7 |
Close
Hashes for sqlalchemy_mutablesoup-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55be5e59cab1cf58fc71051f8daddb3871ef55b0fb148eea76f4963d14395e1b |
|
MD5 | d71854b98a893d6fad3472bc61876a69 |
|
BLAKE2b-256 | ff2a6653f3e333c2fb9cfaba4be1c4e56ea1e7543b63b47b815fc027b7b530c1 |