Skip to main content

PyWorldAtlas: offline world geography for Python

Offline country profiles, physical geography, optional 3D maps, distances, and learning tools for Python.

PyPI Python 3.10–3.14 CI Documentation License: MIT

248 profiles · 248 optional 3D maps · 6,265 populated places · 0 core runtime dependencies

Documentation · Quickstart · Playground · 3D maps · Examples · API reference

No installation needed: open the browser playground and run the guided Python examples.

PyWorldAtlas is an offline world-geography Python package built around one bundled, source-aware database. It turns country profiles, physical geography, cities, distances, borders, optional 3D maps, and learning tools into ordinary Python objects for developers, classrooms, and curious learners. No API key is required, and installed features work offline.

PyWorldAtlas Standard 3D elevation map of Iceland

Iceland rendered by the Standard map edition with elevation, coastline, Reykjavík, a river overlay, and source notes. Select the image for the map guide.

Install

python -m pip install pyworldatlas

PyWorldAtlas supports Python 3.10 through 3.14. The installed package works offline and has no third-party runtime dependencies.

Add the recommended global 3D map edition when you want interactive terrain:

python -m pip install "pyworldatlas[maps]"

Use pyworldatlas[maps-overview] for the smaller Overview edition. Map data is optional, so the core installation stays unchanged. To replace an older installation, add --upgrade to the same command.

Meet a country

from pyworldatlas import Atlas

with Atlas() as atlas:
    brazil = atlas.country("Brazil")
    print(brazil.summary())
🇧🇷 Brazil · Brasil
Formal name: Federative Republic of Brazil
Capital: Brasília
Location: Americas · South America
Population snapshot: 209,469,333
Currency: Brazilian Real (BRL, R$)
Languages: English (en), Spanish (es), French (fr), Portuguese (pt-BR)
Anthem title: Hino Nacional Brasileiro · Brazilian National Anthem
Motto: Ordem e Progresso · Order and Progress
Highest point: Pico da Neblina (2,994 m)
Dominant climate class: Aw · Tropical, savannah
Source-listed rivers: Amazon, Río de la Plata/Paraná, Tocantins
Source-listed lakes: Lagoa dos Patos, Lagoa Mirim

Atlas opens a bundled, read-only SQLite database. Results are immutable, typed models rather than loosely structured dictionaries, and loaded records remain usable after the atlas is closed.

Open the terrain

from pyworldatlas import Atlas

with Atlas() as atlas:
    atlas.map("Iceland").show()

The one-line call opens a local, rotatable 3D map in the default browser with elevation, Köppen-Geiger climate coloring, rivers, the country outline, and the primary capital. Adjust terrain height, show every bundled river name, or hide labels for a clean presentation view. The viewer and data remain offline after installation. Use atlas.map("Iceland").write_html("iceland-map.html") to create a standalone document for a lesson or presentation.

Compare the map editions and learn the API.

What you can explore

Area Included capabilities
Country profiles Codes, names, capitals, population, currencies, languages, timezones, postal formats, anthem titles, reviewed mottos, and demonyms
Names and writing systems English identities, selected local-language names, scripts, reviewed official forms, and source-provided romanization
Physical geography Land and water area, coastline, elevation extremes, rivers, lakes, and climate summaries
Interactive maps Optional offline 3D elevation and climate surfaces for all 248 profiles, with terrain-height controls and selectable river and capital labels
Places and measurement 6,265 cities and capitals with search, nearby-place discovery, readable coordinates, distance, compass direction, bearing, and midpoint calculations
Land connections Reviewed neighbors, shared neighbors, shortest border paths, crossings, and connected components
Learning tools Readable profiles, stable samples, flashcards, deterministic multiple-choice questions, rankings, discovery cards, and Unicode-preserving JSON

Explore with small, readable programs

Look up countries by familiar name or standard code:

with Atlas() as atlas:
    assert atlas.country("Japan") == atlas.country("JP")
    assert atlas.country("JPN") == atlas.country("392")
    print(atlas.country("Japan").name_in("ja"))

Measure and connect places:

with Atlas() as atlas:
    tokyo = atlas.city("Tokyo", country="JP")
    paris = atlas.city("Paris", country="FR")

    print(tokyo.coordinates.format())
    print(tokyo.coordinates.dms())
    print(f"{atlas.distance_between(tokyo, paris):,.0f} km")
    print(tokyo.coordinates.compass_direction_to(paris.coordinates))

    nearby = atlas.nearest_cities(tokyo, within_country="JP", limit=3)
    print([result.city.name for result in nearby])

    route = atlas.border_path("Portugal", "China")
    print(" → ".join(route.names))

Build a repeatable lesson:

with Atlas() as atlas:
    questions = atlas.quiz(topic="local_names", count=5, seed=42)

    for question in questions:
        print(question.prompt)
        for number, choice in enumerate(question.choices, 1):
            print(f"  {number}. {choice}")
        print("Answer:", question.answer_number)

Distances are great-circle surface measurements, not road or flight routes. Border paths use the reviewed land-border graph and do not infer maritime or boundary geometry.

Built for learning

  • Offline: lessons and programs do not depend on an external service.
  • Repeatable: seeded samples, flashcards, and quizzes produce stable results.
  • Source-aware: provenance and coverage limits are documented.
  • Beginner-friendly: common tasks use small Python objects and methods.
  • Honest about missing data: unavailable values remain None or empty tuples.

The project provides factual geography and transparent calculations, not political commentary or opinion. Read the educational and neutrality policy for the formal publication standard.

Coverage at a glance

Library 0.9.3 includes dataset 2026.07.22.7 and schema 7.

Dataset area Coverage
Countries and areas 248
Primary capitals 241 / 248
Populated places 6,265
Selected local-language identities 248 / 248
Anthem titles 234 / 248
Reviewed land-border relationships 319
Highest and lowest points 240 / 248
Köppen-Geiger climate profiles 241 / 248
Overview and Standard map coverage 248 / 248 each

See the generated project status for complete coverage and data quality for interpretation limits.

Data and trust

Field families use defined source roles rather than one unreviewed compilation. The builder retains source snapshots, checksums, review decisions, and exact coverage gates. Sources include United Nations M49, GeoNames, Unicode CLDR, UNGEGN, Natural Earth, the CIA World Factbook, Wikidata, IANA registries, the Beck et al. Köppen-Geiger dataset, and NOAA NCEI ETOPO 2022.

Documentation and community

Questions, factual corrections, documentation improvements, and focused code contributions are welcome. Start with CONTRIBUTING.md, follow the code of conduct, and report security concerns through SECURITY.md.

Development

python maintain.py bootstrap
python maintain.py check

maintain.py check runs tests, builds the core and optional-map distributions, installs the wheels in isolation, renders an offline map, executes examples, builds strict documentation and doctests, and audits the release contents.

License

PyWorldAtlas code is available under the MIT License. Bundled data retains its original terms and attribution; see THIRD_PARTY_NOTICES.md.

Release files for pyworldatlas 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyworldatlas 0.9.3
File Size Uploaded
pyworldatlas-0.9.3.tar.gz 599.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyworldatlas 0.9.3
File Interpreter ABI Platform
pyworldatlas-0.9.3-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / pyworldatlas-0.9.3.tar.gz

Download URL pyworldatlas-0.9.3.tar.gz
Size 599.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c157b197e824ad83b073aaca3362d6405eee55108512c797d8ec00a6dc98d0a0
BLAKE2b-256 checksum
How to use checksums
3fcaedb869aa5ca4f7ce973ad304aa10378dc6be5af9e82271bbf5bb6ae29cc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.

Transparency log

Release files / pyworldatlas-0.9.3-py3-none-any.whl

Download URL pyworldatlas-0.9.3-py3-none-any.whl
Size 565.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e056322bf293421fc47faf7ae9cea0c6f6a44947ca4b3bf7797ca985b23b36e
BLAKE2b-256 checksum
How to use checksums
2fd98146e1d6397228cd169360678b080a89a2e7f3d63a216b118d3fb24d6426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.5

2 release files

0.9.4

2 release files

This release

0.9.3 This release

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.1.0

2 release files

0.0.12

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page