Skip to main content

Flask-Download-Btn

Flask-Download-Btn defines a SQLALchemy Mixin for creating Bootstrap download buttons in a Flask application.

Its key features are:

  1. Automatic enabling and disabling: A download button is automatically disabled on click and re-enabling on download completion.
  2. Web form handling: Applications can modify a download button on click based on web form responses.
  3. Progress bar: Download buttons report progress using a progress bar updated with server-sent events.

Example: Basic use

Suppose we want to include a download button which downloads hello_world.txt accessible at HELLO_WORLD_URL. On click, we want to disable the button and re-enable it when the file finishes downloading.

After setup, we can achieve this with the following:

@app.route('/')
def index():
    btn = DownloadBtn()
    btn.text = 'Download'
    btn.downloads = [(HELLO_WORLD_URL, 'hello_world')]
    db.session.add(btn)
    db.session.commit()
    return render_template('index.html', download_btn=btn)

Documentation

You can find the latest documentation at https://dsbowen.github.io/flask-download-btn.

License

Publications which use this software should include the following citation for SQLAlchemy-Function and its dependencies, SQLAlchemy-Function and SQLAlchemy-Mutable:

Bowen, D.S. (2019). Flask-Download-Btn[Computer software]. https://dsbowen.github.io/flask-download-btn.

Bowen, D.S. (2019). SQLAlchemy-Function [Computer software]. https://dsbowen.github.io/sqlalchemy-function.

Bowen, D.S. (2019). SQLAlchemy-Mutable [Computer software]. https://dsbowen.github.io/sqlalchemy-mutable.

This project is licensed under the MIT License LICENSE.

Metadata

Release files for flask-download-btn 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-download-btn 0.0.8
File Size Uploaded Provenance Actions
flask-download-btn-0.0.8.tar.gz 7.4 kB Without provenance Details for flask-download-btn-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flask-download-btn 0.0.8
File Interpreter ABI Platform Actions
flask_download_btn-0.0.8-py3-none-any.whl Python 3 none any Details for flask_download_btn-0.0.8-py3-none-any.whl

Total release size: 17.2 kB

Release files / flask-download-btn-0.0.8.tar.gz

Download URL flask-download-btn-0.0.8.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7bf8591e63e2dbe35f2a9cce247c710072bda856047a80dd93bbfda649313dee
BLAKE2b-256 checksum
How to use checksums
a2ed5e8730b2620a72426eff89f4e4d1f354b988b7e33b1847bd30c0e2442737
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Release files / flask_download_btn-0.0.8-py3-none-any.whl

Download URL flask_download_btn-0.0.8-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9cafe0a4170342db49d7b709475711feb0569295c91e90c9c70c43e1e5f5649a
BLAKE2b-256 checksum
How to use checksums
3e53cca777ac4c10c6274664f12cd8396afc39c16b25c3f5c324397ba961312b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Security for flask-download-btn 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page