AutoMap is a map-generating tool. Describe what you want in plain language and AutoMap uses AI to collect the data, then paints it onto a map for you — a coloured, labelled map in seconds.
It ships with three parts:
- a CLI (
cli.py/ theautomapcommand), - a web UI (a small Flask app in
main.py), - and a Python API (
map.auto_map.auto_map).
AutoMap can render three map types:
| Map type | Description |
|---|---|
default |
Europe (default map) |
flag |
Europe with flag-style borders |
world |
World map grouped by continent |
Data can be shown in two modes:
text— categorical values (e.g.Coffee→ a specific colour).number— numeric values, coloured by value ranges.
Optional extras:
show_most_least— highlight the country/continent with the most and least of a value.short_form— shorten large numbers (e.g.1000000→1M).
Here is an example (default map):
Libraries AutoMap uses today:
- AI
- Drawing
- Web UI
- CLI
- Other
To get started with AutoMap, follow these steps:
-
Clone the repository:
git clone https://github.com/deltaaa00/auto_map.git cd automap -
Set up a virtual environment:
python -m venv venv # Windows: venv\Scripts\activate # macOS / Linux: source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
For testing, install
requirements-test.txtinstead. It includes runtime dependencies and test tools. See tests/README.md for test commands. -
Configure your API key: AutoMap reads
GEMINI_API_KEYfrom a.envfile (seeexample.env).- Copy
example.envto.env. - Get a key from Google AI Studio.
- Set it in
.env:GEMINI_API_KEY=your_key_here.
On Windows/macOS you can also use the helper scripts in
util/(key_man.bat,key_man.command) to manage the key. - Copy
-
Create your filling configuration: Copy the template so colours can be applied:
cp map/filling.template.json map/filling.json
Start the Flask server:
python main.pyThen open http://127.0.0.1:5000/ in your browser. If no key is found in .env, the UI prompts you to paste one; otherwise it uses the key from .env automatically.
Generate a map straight from the terminal:
python cli.py make "Population of European countries" -m number -mp defaultFlags:
-m, --mode—text(default) ornumber-mp, --map-type—default(default),flagorworld-gsm, --global-size-modifier— global font size modifier (default15)-eop, --extra-option—none(default),show_most_leastorshort_form--model— AI model to use--temperature— response randomness from0to2; omit for the model default. The web slider defaults to0.75and remembers your selection. This controls sampling, not factual accuracy.--font— font file name fromresources/fonts--show/--no-show— open the result image after generating-v, --verbose— print detailed progress output
After installing the package (pip install -e .) you can also use the automap command:
automap make "Population of European countries" -m number -mp defaultThe result is saved as result.png.
AutoMap ships with a few default fonts. You can drop your own .ttf / .otf files into resources/fonts and select them on the map.
You can define colours for your data in map/filling.json. It contains two dictionaries:
filling_txt— colours fortextmode. For example, if the data isTea, the colour is(246, 255, 0, 255).filling_num— colours fornumbermode, keyed by value ranges. For example,(100,200)means value > 100 and value <= 200 →(235, 40, 33, 255).
AutoMap uses RGBA. The last number must be
255.
{
"filling_txt": {
"Tea": [246, 255, 0, 255],
"Coffee": [54, 4, 4, 255]
},
"filling_num": {
"(100,200)": [235, 40, 33, 255]
}
}The web UI can be deployed to Vercel. The repository root contains a vercel.json that builds AutoMap-cli/main.py with the Python runtime.
- Set
GEMINI_API_KEYunder Project → Settings → Environment Variables (do not commit a.env). - Deploy. If no key is configured, the UI simply prompts the visitor for one.
Note that AI + image generation can be slow, and Vercel's Hobby plan has short function time limits — a paid plan may be needed for larger requests.
This project is licensed under the Apache License 2.0.
Copyright © 2025-2026 deltaaa00.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


