Skip to main content

Flask Variable Manager

The Flask Variable Manager is a Flask extension that allows you to manage variables within your Flask application.

It provides an interface to set and get variables, and even render them in Jinja2 templates.

This can be useful when you need to share data across different parts of your application.

Installation

To install the Flask Variable Manager, you can use pip:

pip install flask-variable-manager

Usage

First, import the VariableManagerExtension from the flask_variable_manager package:

Then, create an instance of the VariableManagerExtension and initialize it with your Flask application:

from flask import Flask
from flask_variable_manager import VariableManagerExtension

vm = VariableManagerExtension()
app = Flask(__name__)
vm.init_app(app)

Now, you can use the VariableManagerExtension to set and get variables in your Flask routes.

vm._local['my_var'] = 'Hello, World!'
vm._local['my_var']

Routes

Render a string as a Jinja2 template

This route allows you to render a string as a Jinja2 template.

It accepts a POST request at the /vm/render endpoint.

Set a user-defined variable

This route allows you to set a user-defined variable.

It accepts a POST request at the /vm/var endpoint.

Get all user-defined variables

This route allows you to get all user-defined variables.

It accepts a GET request at the /vm/var endpoint.

(or vm/vars for the multiple count of the variable)

Remove a user-defined variable

This route allows you to remove a user-defined variable.

It accepts a DELETE request at the /vm/var endpoint.

(or vm/vars for the multiple count of the variable)

Run a Python script and return the result

This route allows you to run a Python script and return the result.

It accepts a POST request at the /py/runner endpoint.

import platform
from flask import g
data = additionalProp + "-" + platform.platform()
g.local['saved_user_variable'] = data
return data

Check the list of packages

This route allows you to check the list of python packages.

It accepts a GET request at the /py/packages endpoint.

install and uninstall a package

This route allows you to install and uninstall a python package.

It accepts a POST request at the /py/install, /py/uninstall endpoint.

License

This project is licensed under the terms of the MIT license.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Metadata

Release files for flask-variable-manager 0.4.1

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-variable-manager 0.4.1
File Size Uploaded Provenance Actions
flask_variable_manager-0.4.1.tar.gz 5.6 kB Without provenance Details for flask_variable_manager-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flask-variable-manager 0.4.1
File Interpreter ABI Platform Actions
flask_variable_manager-0.4.1-py3-none-any.whl Python 3 none any Details for flask_variable_manager-0.4.1-py3-none-any.whl

Total release size: 12.0 kB

Release files / flask_variable_manager-0.4.1.tar.gz

Download URL flask_variable_manager-0.4.1.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5e4a0b00f6fc744e7484039a76b5ccc3a5b671d53b20302669dfaec193bf5100
BLAKE2b-256 checksum
How to use checksums
5d4795d28bbba52651ac73af99800953a30fe9e915c81c5d366542ec4320cfd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / flask_variable_manager-0.4.1-py3-none-any.whl

Download URL flask_variable_manager-0.4.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db831fad94fd0d6a62ac8c61427f85c8d3daea4b82ae5b9d07edf44689f3a429
BLAKE2b-256 checksum
How to use checksums
87fc9436678a8d1062dc56e4a42871e57d4573e7beddf9ed3fec6c4181f13b33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Security for flask-variable-manager 0.4.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.

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