Skip to main content

Mutable BeautifulSoup database type

Project description

SQLAlchemy-MutableSoup defines a mutable BeautifulSoup SQLAlchemy database type.


$ pip install sqlalchemy-mutablesoup


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)


model = Model()

You can now treat model.soup as a bs4.BeautifulSoup object.


  author = {Dillon Bowen},
  title = {SQLAlchemy-MutableSoup},
  url = {},
  date = {2020-06-04},


Users must cite this package in any publications which use it.

It is licensed with the MIT License.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlalchemy-mutablesoup-0.0.9.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

sqlalchemy_mutablesoup-0.0.9-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page