Visualize Flask request locations cartographically
Project description
flask-geomapper
Visualize Flask request locations cartographically.
This python library allows you to map Flask request locations on a map using their IPs. This allows you to get a better understanding of your users and audience.
Example map:
Installation
pip3 install flask-geomapper
Demo
https://flask-geomapper.herokuapp.com (locations cleared periodically). Source can be found at "examples/heroku".
Quickstart
Here is a simple example of flask-geomapper. An explaination can be found in "examples/basic.py".
import flask
from flask_geomapper import flask_geomapper
app = flask.Flask(__name__)
fg = flask_geomapper(app, count_trigger=app.before_request, debug=True)
@app.route("/")
def show_map():
return flask.send_file(fg.get_img(), mimetype="image/png")
app.run(debug=True, use_reloader=False)
Examples
Examples can be found in the examples directory.
Basic usage: "basic.py"
AWS S3 integration: "aws_s3.py"
Modifying count triggers: "count_triggers.py"
Database integration: "database_integration.py"
Clear old locations: "remove_first_location_on_interval.py"
Ignore routes and status codes: "ignore_routes_and_statuses.py"
Manually add locations: "manual_history_append.py"
Heroku deployment: "heroku/"
Commercial usage
For commercial usage, you must use an API key at members.ip-api.com.
Project details
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
File details
Details for the file flask-geomapper-3.0.1.tar.gz
.
File metadata
- Download URL: flask-geomapper-3.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f4bdce93454d88b6541aa822973959677a1f2661b27690d7e02b675ebe3f2c3 |
|
MD5 | 01b32ce534bf49148a35640c18437cf6 |
|
BLAKE2b-256 | fd7d0d5d0e05a3f017526746eb1a6d41be0a993484f56c4f78105aa8a36855d2 |
File details
Details for the file flask_geomapper-3.0.1-py3-none-any.whl
.
File metadata
- Download URL: flask_geomapper-3.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09c946d0b8f3ef0a1b6a11a67e3a22f3518578204adaa67a2e642a6283a44d01 |
|
MD5 | 14dcc6cd780089892aa5944eb752fc9d |
|
BLAKE2b-256 | 3a2b60ae26b5d38e94bd49653968d54cf380d1cbda9d72e23a53cae8b70ec1d3 |