Skip to main content

Interactive epidemiological spot maps for India

Project description

SpotMap

Interactive epidemiological spot maps for India

SpotMap turns a CSV of case/control coordinates into a publication-ready interactive HTML map with:

  • Dot density clustering (cases only)
  • Spot map pins (cases and/or controls) with custom colours
  • Automatic state/district boundary overlays (bundled data — no shapefile setup needed)
  • Sidebar with mode toggle, colour pickers, pin size slider, and PNG/PDF export
  • Smart auto-detection of latitude, longitude, and outcome columns

Installation

pip install spotmap

Quick start

Interactive (no coding required)

The easiest way — works great in Google Colab or a Jupyter notebook. Paste these two lines into a cell and run it:

!pip install spotmap
from spotmap import spotmap_run
spotmap_run()

SpotMap then walks you through a few simple prompts:

  1. Upload your data file (in Colab an upload button appears; elsewhere it asks for the file path).
  2. Confirm which columns hold latitude, longitude, and the case/control outcome (SpotMap pre-selects its best guess).
  3. Pick which value means "case".

The finished map is shown right in the notebook cell — no need to hunt for a file — and is also saved as spotmap.html (pass a different name with spotmap_run("my_map.html")).

In a plain terminal, spotmap_run() reads your answers from the keyboard and saves an HTML file to open in your browser. For automated scripts, use the Python API below instead.

Python API

from spotmap import SpotMap

SpotMap("my_data.csv").build().save("map.html")

Command line

spotmap my_data.csv -o map.html

CSV format

SpotMap auto-detects columns — no strict naming required.

Requirement Details
Coordinates Separate lat / lon columns or a combined "lat,lon" column
Outcome A column named outcome, status, case_control, etc. with values like case / control

Example:

latitude,longitude,outcome
28.6,77.2,case
19.0,72.8,control
13.0,80.2,case

Python API reference

SpotMap(
    csv_path,                       # required
    state_shp=None,                 # custom state boundary (shapefile/GeoPackage)
    district_shp=None,              # custom district boundary
    lat_col=None,                   # override auto-detection
    long_col=None,
    outcome_col=None,
    case_value=None,                # value that means "case" in outcome_col
    count_cutoff=2,                 # districts ≤ cutoff → district zoom
    margin_deg=1.0,                 # boundary crop padding
    cluster_color="#E85252",        # dot-density bubble colour
    case_color="#D55757",           # case pin colour
    control_color="#7676E7",        # control pin colour
)

Chain calls:

sm = SpotMap("data.csv", case_color="#FF0000").build()
sm.save("map.html")

# Access the raw Folium map for further customisation
folium_map = sm.map

CLI reference

usage: spotmap [-h] [-o OUTPUT] [--state-shp STATE_SHP]
               [--district-shp DISTRICT_SHP] [--lat-col LAT_COL]
               [--lon-col LON_COL] [--outcome-col OUTCOME_COL]
               [--case-value CASE_VALUE] [--count-cutoff COUNT_CUTOFF]
               [--cluster-color CLUSTER_COLOR] [--case-color CASE_COLOR]
               [--control-color CONTROL_COLOR]
               csv

Team

SpotMap is developed by the ADARV team:

Name Role
Muniraj Mallesan Maintainer
Dr. Sharan Murali Team Lead
Manikandan K
Shanmuga Sundharam
Yogita Chaudhary
Barath U
Balaji S
Deepana R

License

MIT © ADARV

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

spotmap-0.1.24.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spotmap-0.1.24-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file spotmap-0.1.24.tar.gz.

File metadata

  • Download URL: spotmap-0.1.24.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for spotmap-0.1.24.tar.gz
Algorithm Hash digest
SHA256 797ce976ec5bdf17e0db871f4f4337a6f1dc8e2969c983d2f495b861fbadc43a
MD5 3be6996c4622f3a48e09d73ad2358a0a
BLAKE2b-256 49c721c9df7f37e3ef85d0c09e0ade457f797083019b30a210f6b6d08be61224

See more details on using hashes here.

File details

Details for the file spotmap-0.1.24-py3-none-any.whl.

File metadata

  • Download URL: spotmap-0.1.24-py3-none-any.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for spotmap-0.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 c2e469decef880de59fce37b68f87a3095c28731874f28ca094c06119d605990
MD5 91ceb5daa96554ad1bbf350c4c7f534a
BLAKE2b-256 99a94711c895b32c8d393882c1af5a7b2b3993b456032f636e4d36df3d88aecf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page