Offline country profiles, physical geography, cities, distances, and learning tools
Project description
PyWorldAtlas: offline world geography for Python
Offline country profiles, physical geography, cities, distances, and learning tools for Python.
248 profiles · 6,265 populated places · 319 reviewed land borders · 0 runtime dependencies
Documentation · Playground · Learning lab · Five-minute tour · Recipes · 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, and learning tools into ordinary Python objects for developers, classrooms, and curious learners. No API key or runtime download is required.
Install
python -m pip install --upgrade pyworldatlas
PyWorldAtlas supports Python 3.10 through 3.14. The installed package works offline and has no third-party runtime dependencies.
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.
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 |
| 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
Noneor 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.8.1 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 |
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, and the Beck et al. Köppen-Geiger dataset.
- Data sources and freshness
- Data quality and limitations
- Educational purpose and editorial policy
- Third-party notices
Documentation and community
- Run Python in the browser
- Try the classroom-friendly learning lab
- Browse complete recipes
- Read the country-profile guide
- Explore physical geography
- Review the API
- See the roadmap
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 both distributions, installs the wheel in
isolation, 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyworldatlas-0.8.1.tar.gz.
File metadata
- Download URL: pyworldatlas-0.8.1.tar.gz
- Upload date:
- Size: 591.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74d1a8da28b95adacff893e0068d3367b0f9dafab6824052376556cce2fc0548
|
|
| MD5 |
be21e313b5b555696b2e44c2f86374a6
|
|
| BLAKE2b-256 |
498dbb643b5ce15c26e32bb4a901d18d8a3758c09246d5d0dfdd6463f17121ff
|
Provenance
The following attestation bundles were made for pyworldatlas-0.8.1.tar.gz:
Publisher:
release.yml on jcari-dev/pyworldatlas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyworldatlas-0.8.1.tar.gz -
Subject digest:
74d1a8da28b95adacff893e0068d3367b0f9dafab6824052376556cce2fc0548 - Sigstore transparency entry: 2256329610
- Sigstore integration time:
-
Permalink:
jcari-dev/pyworldatlas@78efa98bd951f5b92af538ac4cc433301ab9eafb -
Branch / Tag:
refs/tags/v0.8.1 - Owner: https://github.com/jcari-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@78efa98bd951f5b92af538ac4cc433301ab9eafb -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyworldatlas-0.8.1-py3-none-any.whl.
File metadata
- Download URL: pyworldatlas-0.8.1-py3-none-any.whl
- Upload date:
- Size: 563.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b17cd37ef7b65a129c48c805fcc46fdcff2fcc02b3d1d4a5d01b9add72ddcf8
|
|
| MD5 |
a646289129ddfa39f61684dae8ed857e
|
|
| BLAKE2b-256 |
7a8ec978bb81304a6f888d04e4cfe76e76cf9ac5e06fbda3e60cc27c103e8975
|
Provenance
The following attestation bundles were made for pyworldatlas-0.8.1-py3-none-any.whl:
Publisher:
release.yml on jcari-dev/pyworldatlas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyworldatlas-0.8.1-py3-none-any.whl -
Subject digest:
8b17cd37ef7b65a129c48c805fcc46fdcff2fcc02b3d1d4a5d01b9add72ddcf8 - Sigstore transparency entry: 2256329619
- Sigstore integration time:
-
Permalink:
jcari-dev/pyworldatlas@78efa98bd951f5b92af538ac4cc433301ab9eafb -
Branch / Tag:
refs/tags/v0.8.1 - Owner: https://github.com/jcari-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@78efa98bd951f5b92af538ac4cc433301ab9eafb -
Trigger Event:
push
-
Statement type: