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. 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.query.filter_by(name='example1').first()
    if not btn:
        btn = DownloadBtn()
        btn.name = 'example1'
        btn.text = 'Download Example 1'
        btn.filenames = ['hello_world.txt']
        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.

Release files for flask-download-btn 0.0.5

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.5
File Size Uploaded
flask-download-btn-0.0.5.tar.gz 8.7 kB Details

Built distribution (wheel)

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

Total release size: 19.4 kB

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

Download URL flask-download-btn-0.0.5.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4375bb6e4e0a8aa2f9a5867b2d59d74dda3512f4fd230195ab9785d48562e603
BLAKE2b-256 checksum
How to use checksums
725465fccbe3a80b39c86ba61e00893aa46b6d098b3c449517d186f6e24dac5d
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.5-py3-none-any.whl

Download URL flask_download_btn-0.0.5-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8da78ac1c7b42be7c6d73562ab1eab89827c168ef3d20a642932cb2d3930b179
BLAKE2b-256 checksum
How to use checksums
8e536d3e97a3bbebb6a8b0a996d42c85e7ec5d724ec75da97d8cf084714f5313
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 history Release notifications | RSS feed

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

1 release file

0.0.17

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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