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
File details
Details for the file sqlalchemy-mutablesoup-0.0.9.tar.gz
.
File metadata
- Download URL: sqlalchemy-mutablesoup-0.0.9.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17053e51dcc03df2911a4d2b41b137375d8714f21cf302b316eb1cddd5bb37f1 |
|
MD5 | 9ea684d1d8ef33c22447769840ef8872 |
|
BLAKE2b-256 | 0f2ff07d3c354efa4130c2ae3c0cdbefa9ecf7bb8f5f5cdf166ea8901f4c6c8d |
File details
Details for the file sqlalchemy_mutablesoup-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: sqlalchemy_mutablesoup-0.0.9-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3c37b08ad2dcd915eeefa970fa83ca58417a471a55dbb1f54c6e4c1cd595cd0 |
|
MD5 | 0e1e0cf7f7bce56a7320e8a9405d657a |
|
BLAKE2b-256 | 2e4941b932caf8f34ff7280874ec9687e3cb339c1a33bf741ed4541909a9741c |