Flask-Plots
Flask-Plots is a library for creating and rendering static visualizations using Matplotlib in Python.
Requirements
Python 3.8+
Dependecies for this project.
- matplotlib(>=3.4.0) for plots management
- Flask(>=2.0.2) for build the backend.
intallation
You can install via pip:
$> pip install Flask-Plots
For development, clone the official github repository instead and use:
$ git clone git@github.com:juniors90/Flask-Plots.git
$ cd Flask-Plots
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements/dev.txt
Quick start
With Flask-Plots you can instance the Plots object and document your endpoints.
from flask import Flask, render_template_string
from flask_plots import Plots
import matplotlib
from matplotlib.figure import Figure
import numpy as np
app = Flask(__name__)
plots = Plots(app)
# routes
@app.route("/")
def bar():
# Make data:
countries = ["Argentina", "Brasil", "Colombia", "Chile"]
peoples = [14, 40, 16, 24]
# Plot:
fig = Figure()
ax = fig.subplots()
ax = plots.bar(fig, countries, peoples)
ax.set_title("Bar Chart")
data = plots.get_data(fig)
return render_template_string(
"""
{% from 'plots/utils.html' import render_img %}
{{ render_img(data=data, alt_img='my_img') }}
""",
data=data
)
if __name__ == "__main__":
app.run(port=5000, debug=True)
Links
Authors
- Ferreira, Juan David
Please submit bug reports, suggestions for improvements and patches via the (E-mail: juandavid9a0@gmail.com).
Official repository and Issues
Acknowledgment
Thank you to Juan B. Cabral, and Martin Chalela for his teachings during Curso doctoral FAMAF: Diseño de software para cómputo científico, from which this library is based.
License
Flask-Plots is free software you can redistribute it and/or modify it
under the terms of the MIT License. For more information, you can see the
LICENSE file
for details.
Metadata
Release files for Flask-Plots 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| Flask-Plots-0.0.1.tar.gz | 8.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Flask_Plots-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.2 kB
Release files / Flask-Plots-0.0.1.tar.gz
| Download URL | Flask-Plots-0.0.1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4115548b2960b13a44f030afff3fb35c9cd866f578125b383093690683064f0f
|
|
BLAKE2b-256 checksum How to use checksums |
f57e118194625fe36df88bdeee1d20da5723376ba5cad9f05a27b18247382c29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / Flask_Plots-0.0.1-py3-none-any.whl
| Download URL | Flask_Plots-0.0.1-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56eea05f7eeba325cff37ae67fa438c9dfa132db24098b339e3dc096ad79b75e
|
|
BLAKE2b-256 checksum How to use checksums |
194d45bb760a21bd74cfb471a591202ff7d075a06bf60b7dfcab8a7e91a2af70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Security for Flask-Plots 0.0.1
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.