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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 327d2cb5c2cb9158134d2d5af8858bf711e6b5439f33ece4b33f3e6422c7f4a3 |
|
MD5 | 2cef4c1d611abd4286b7ad62ed6e643a |
|
BLAKE2b-256 | e93d34d04d4ef2f3ad9968f80a2e8534e34aaff4b6b0caff9e8a434ef5f8701b |
Close
Hashes for sqlalchemy_mutablesoup-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afda4e80d19c31e48ef9747dd3591651c0c453c8e0105af8fb4170759848b7b3 |
|
MD5 | c3a2b77d5717173479b721cffaaaf8cf |
|
BLAKE2b-256 | 63ff7d370547371d7554517709399a392100fbf6d141259508aeb539a6ed0348 |