A Python wrapper to distribute Bootstrap CSS/JS assets
Project description
bootstrap-wrapper
Python Wrapper for Bootstrap CSS/JavaScript Assets
Overview
This repository automatically syncs with the latest Bootstrap distribution files from the official Bootstrap repository and packages them for easy distribution via Python's packaging system.
✨ NEW: Now installable as a Python package!
pip install bootstrap-wrapper==5.3.8
Bootstrap Assets
This repository automatically syncs with the latest Bootstrap distribution files from the official Bootstrap repository.
Installation & Usage
Install from PyPI (Recommended)
pip install bootstrap-wrapper==5.3.8
Usage in Web Frameworks
FastAPI Example:
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
import bootstrap_wrapper
app = FastAPI()
# Get Bootstrap assets path
static_path = bootstrap_wrapper.get_bootstrap_dir()
# Mount Bootstrap static files
app.mount("/bootstrap", StaticFiles(directory=str(static_path)), name="bootstrap")
# Access Bootstrap at:
# http://localhost:8000/bootstrap/css/bootstrap.min.css
# http://localhost:8000/bootstrap/js/bootstrap.bundle.min.js
Flask Example:
from flask import Flask, send_from_directory
import bootstrap_wrapper
app = Flask(__name__)
BOOTSTRAP_PATH = bootstrap_wrapper.get_bootstrap_dir()
@app.route('/bootstrap/<path:filename>')
def bootstrap_static(filename):
return send_from_directory(str(BOOTSTRAP_PATH), filename)
Django Example:
# In settings.py
import bootstrap_wrapper
BOOTSTRAP_STATIC_ROOT = bootstrap_wrapper.get_bootstrap_dir()
STATICFILES_DIRS = [
BOOTSTRAP_STATIC_ROOT,
]
Automatic Updates
- Schedule: The Bootstrap assets are automatically updated weekly on Mondays at 09:00 UTC
- Manual Trigger: You can manually trigger an update by running the "Sync Bootstrap Dist" workflow
- Force Update: Use the
force_updateoption to force an update even if the version is the same
- Force Update: Use the
- Auto-Merge: When a new Bootstrap version is available, the workflow automatically:
- Creates a pull request with the updated files
- Auto-merges the PR (no manual review required)
- Creates a git tag matching the Bootstrap version (e.g.,
5.3.8) - Creates a GitHub release automatically
- Triggers PyPI publishing via the existing publish workflow
Bootstrap Files
The Bootstrap distribution files are stored in the bootstrap/ directory:
bootstrap/css/- Bootstrap CSS files (minified and source)bootstrap/js/- Bootstrap JavaScript files (minified and source)bootstrap/version.txt- Current Bootstrap version
Workflow
The sync process uses the GitHub Actions workflow located at .github/workflows/sync-bootstrap-dist.yml which:
- Checks the latest Bootstrap release via GitHub API
- Compares with the current version in
bootstrap/version.txt - Downloads and extracts the official Bootstrap dist ZIP if an update is needed
- Creates a pull request with the updated files
- Auto-merges the pull request immediately (no manual review required)
- Creates a git tag matching the Bootstrap version for PyPI releases
- Creates a GitHub release automatically
- Triggers PyPI package publishing through the existing publish workflow
Development
Run the example script to see usage examples:
python example_usage.py
Publishing to PyPI
The project is automatically published to PyPI as bootstrap-wrapper when:
- A new GitHub release is created
- The GitHub Actions workflow runs successfully
For manual publishing (if needed):
# Install build tools
pip install build twine
# Build the package
python -m build
# Upload to PyPI (requires API token)
twine upload dist/*
Note: The package uses trusted publishing via GitHub Actions, so manual uploads should generally not be necessary.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Bootstrap itself is also licensed under 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bootstrap_wrapper-5.3.8.post1.tar.gz.
File metadata
- Download URL: bootstrap_wrapper-5.3.8.post1.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed3cb6be67cb343d0637226b3f865f88ad146d4bd2b6874c10ca8407089d2c5e
|
|
| MD5 |
5332ef23822bf91068d7cc04173b81e8
|
|
| BLAKE2b-256 |
691432d7dbe809ea1946c37dee2f24edac4dea1e5ee73c22645c7db586b01481
|
Provenance
The following attestation bundles were made for bootstrap_wrapper-5.3.8.post1.tar.gz:
Publisher:
publish.yml on MaximilianClemens/python-bootstrap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bootstrap_wrapper-5.3.8.post1.tar.gz -
Subject digest:
ed3cb6be67cb343d0637226b3f865f88ad146d4bd2b6874c10ca8407089d2c5e - Sigstore transparency entry: 516372592
- Sigstore integration time:
-
Permalink:
MaximilianClemens/python-bootstrap@364ed4d7b9240845b66d986966297cbc029bf523 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MaximilianClemens
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@364ed4d7b9240845b66d986966297cbc029bf523 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bootstrap_wrapper-5.3.8.post1-py3-none-any.whl.
File metadata
- Download URL: bootstrap_wrapper-5.3.8.post1-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbddca3e930a9f9e0bba445b2df058d0e52f2b6f5e9a0a7b9d4986a6c1aadc79
|
|
| MD5 |
8914d6d34e765703edaf6c56001876e7
|
|
| BLAKE2b-256 |
2fcafbafbe354751a1faf930b63910fa1fa0dba18b15393882787450a9886554
|
Provenance
The following attestation bundles were made for bootstrap_wrapper-5.3.8.post1-py3-none-any.whl:
Publisher:
publish.yml on MaximilianClemens/python-bootstrap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bootstrap_wrapper-5.3.8.post1-py3-none-any.whl -
Subject digest:
dbddca3e930a9f9e0bba445b2df058d0e52f2b6f5e9a0a7b9d4986a6c1aadc79 - Sigstore transparency entry: 516372604
- Sigstore integration time:
-
Permalink:
MaximilianClemens/python-bootstrap@364ed4d7b9240845b66d986966297cbc029bf523 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MaximilianClemens
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@364ed4d7b9240845b66d986966297cbc029bf523 -
Trigger Event:
push
-
Statement type: