Mapkick Static.py
Create beautiful static maps with one line of Python. No more fighting with mapping libraries!
For JavaScript maps, check out Mapkick.py
Installation
Run:
pip install mapkick-static
Then follow the instructions for your web framework:
Mapkick Static uses the Mapbox Static Images API. Create a Mapbox account to get an access token and set os.environ['MAPBOX_ACCESS_TOKEN'] in your environment.
Django
Create a map in a view
from mapkick.static import StaticMap
def index(request):
map = StaticMap([{'latitude': 37.7829, 'longitude': -122.4190}])
return render(request, 'home/index.html', {'map': map})
And add it to the template
{{ map }}
Flask
Create a map in a route
from mapkick.static import StaticMap
def index():
map = StaticMap([{'latitude': 37.7829, 'longitude': -122.4190}])
return render_template('home/index.html', map=map)
And add it to the template
{{ map }}
Maps
Point map
StaticMap([{'latitude': 37.7829, 'longitude': -122.4190}])
Area map
StaticAreaMap([{'geometry': {'type': 'Polygon', 'coordinates': ...}}])
Data
Data can be an array
StaticMap([{'latitude': 37.7829, 'longitude': -122.4190}])
Point Map
Use latitude or lat for latitude and longitude, lon, or lng for longitude
You can specify a color for each data point
{
'latitude': ...,
'longitude': ...,
'color': '#f84d4d'
}
Area Map
Use geometry with a GeoJSON Polygon or MultiPolygon
You can specify a color for each data point
{
'geometry': {'type': 'Polygon', 'coordinates': ...},
'color': '#0090ff'
}
Options
Width and height
StaticMap(data, width=800, height=500)
Alt text
StaticMap(data, alt='Map of ...')
Marker color
StaticMap(data, markers={'color': '#f84d4d'})
Map style
StaticMap(data, style='mapbox/outdoors-v12')
History
View the changelog
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/mapkick-static.py.git
cd mapkick-static.py
pip install --group dev
pytest
Metadata
Release files for mapkick-static 0.2.0
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 | Actions |
|---|---|---|---|---|
| mapkick_static-0.2.0.tar.gz | 5.5 kB | Without provenance | Details for mapkick_static-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mapkick_static-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for mapkick_static-0.2.0-py3-none-any.whl |
Total release size: 10.7 kB
Release files / mapkick_static-0.2.0.tar.gz
| Download URL | mapkick_static-0.2.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6b11d06c761677e86d812b3004f66bc8493fba5515f6a36d2523bb4dee76028
|
|
BLAKE2b-256 checksum How to use checksums |
32e8921757a42824e7e6bb827f45c0b1783cf1f4ae807e17f98ed30d4355e01a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mapkick_static-0.2.0-py3-none-any.whl
| Download URL | mapkick_static-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef77763656a6b39716bcc586ed6d1124561ee933e9e40c1fd6f0b0d62c1e4e84
|
|
BLAKE2b-256 checksum How to use checksums |
b66a8a6b69a063fe3bf5b425e32a60fa7cffe0d5e284b03876bd01eb0bbcb0b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for mapkick-static 0.2.0
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.