Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
gadhagod committed May 8, 2021
1 parent e877ae7 commit edc6072
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,36 @@
Visualize Flask request locations cartographically.

## Installation
Since this package is still in development, you must install from GitHub.

pip3 install git+https://github.com/gadhagod/flask-geomapper
pip3 install flask-geomapper

Installing a specific version:
pip3 install https://github.com/gadhagod/flask-geomapper@[version]
## Demo
[https://flask-geomapper.herokuapp.com](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" \
Clear old locations: "remove_first_location_on_interval.py" \
Ignore routes and status codes: "ignore_routes_and_statuses" \
Heroku deployment: "heroku/"

## Commercial usage
For commercial usage, you must use an API key at [members.ip-api.com](https://members.ip-api.com).
2 changes: 2 additions & 0 deletions examples/heroku/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Find the deployed app at https://flask-geomapper.herokuapp.com.
Same as `examples/basic.py`.
NOTE: Map will be cleared if dynos restart.
"""

import flask
Expand Down

0 comments on commit edc6072

Please sign in to comment.