Comprehensive offline datasets for global country, currency, and geography metadata.
Project description
worlddatax
worlddatax is a production-ready Python package that ships an up-to-date, structured snapshot of worldwide geographic and country metadata. It exposes a simple, beginner-friendly API that reads from packaged JSON datasets covering every UN-recognised sovereign state.
Features
- 195 countries with ISO codes, capitals, continents, currencies, and international dialling prefixes
- Deep-dives for key markets with state, province, and city coverage
- Clean Python functions that never print or raise on missing records—receiving
Noneor empty collections instead - Zero runtime network access; all data is bundled in JSON and loaded on demand with caching
Installation
Install the library directly from a source checkout or from PyPI (when published):
pip install worlddatax
For local development use:
pip install -e .
Quick start
from worlddatax import (
get_all_countries,
get_country_by_iso,
get_countries_by_continent,
get_states,
get_cities,
get_currency,
get_phone_code,
)
india = get_country_by_iso("IND")
asia = get_countries_by_continent("Asia")
states = get_states("United States")
california_cities = get_cities("United States", "California")
yen = get_currency("Japan")
usa_codes = get_phone_code("United States")
print(india["capital"]) # New Delhi
print(len(asia)) # 46
print(states[:3]) # ['Alabama', 'Alaska', 'Arizona']
print(california_cities) # ['Los Angeles', 'San Francisco']
print(yen) # {'code': 'JPY', 'name': 'Japanese yen', 'symbol': '¥'}
print(usa_codes) # ['+1']
Packaged data
- Countries: names, ISO-2, ISO-3, capitals, continents, currency metadata, international calling prefixes
- States and provinces: complete lists for Australia, Brazil, Canada, China, France, Germany, India, and the United States
- Cities: curated coverage for major regions within the above countries
- Currencies: code, display name, and symbol for every currency referenced by the dataset
- Continents: continent-to-country mappings for simplified grouping
Datasets are fetched from the public REST Countries service during packaging and bundled into JSON files inside the distribution. All files are UTF-8 encoded and ship with the wheel, ensuring offline availability.
Project layout
worlddatax/
worlddatax/ # Package modules
data/ # JSON datasets bundled with the wheel
tests/ # Automated contract checks
Testing
Run the included test suite with pytest:
pytest
License
worlddatax is released under the MIT License. See LICENSE for details.
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 worlddatax-1.0.0.tar.gz.
File metadata
- Download URL: worlddatax-1.0.0.tar.gz
- Upload date:
- Size: 43.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2365ed059a29a5e13cb6ae92a72a27275582b228aa1451d3ceb572f2c6f73ff
|
|
| MD5 |
a1b37f90e268d595bac136f7ee951301
|
|
| BLAKE2b-256 |
c5a7b33c514f2861368ce8fd8c24a29ab182d6bffd8954e715f5fa15cf51b1b3
|
File details
Details for the file worlddatax-1.0.0-py3-none-any.whl.
File metadata
- Download URL: worlddatax-1.0.0-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f87d561ca13432df8362d31ed8c88b27a25e05643f22e96910c48fbeb5c24f0
|
|
| MD5 |
836b84e6e89b9f6b0c15dd9ef97c6d14
|
|
| BLAKE2b-256 |
686ca160dda0fb7e1864725be197a473fc93119a41f35e36dfa98d9c67e42682
|