Skip to content

Instantly share code, notes, and snippets.

View cbcafiero's full-sized avatar

Clayton Cafiero cbcafiero

  • Vermont (U.S.A.)
View GitHub Profile
@cbcafiero
cbcafiero / replacements.py
Last active November 3, 2022 09:00
Easy multiple search and replace by tag and attribute with BeautifulSoup
"""
Sometimes you want to make several different replacements. Search by tag with
optional attributes. Replace with tag with optional attributes.
Thank you to Dan @ University of Exeter for bug fix
"""
from bs4 import BeautifulSoup
REPLACEMENTS = [('b', {}, 'strong', {}),
@cbcafiero
cbcafiero / .gitignore
Last active December 9, 2021 13:24
Global .gitignore
# Keys
*.key
*.pub
# OSX file system junk
.DS_Store
# Python cache, bytecode, and other
__pycache__
*.pyc