Skip to main content

worldref (Python)

242 countries and territories in Arabic and English: names, aliases, phone plans, currencies, geo, locale, addresses, subdivisions, plus search, sorting, phone parsing and address forms. Standard library only, Python 3.9 or newer.

Install

pip install worldref

Usage

from worldref import countries, by_iso2, search, sort_countries, parse_phone, address_form, subdivisions

sa = by_iso2("sa")
print(sa.name_ar, sa.name_en, sa.flag)                  # السعودية Saudi Arabia 🇸🇦
print([c.iso2 for c in search(countries(), "سعودية", "ar")][:3])
print(search(countries(), "Kuwiat")[0].iso2)            # KW (small typos are forgiven when nothing matches)
print([c.name_en for c in sort_countries(countries(), "en", first="SA")][:3])
p = parse_phone("0501234567", sa, countries())
print(p.e164, p.valid, p.mobile)                        # +966501234567 True True
for line in address_form(sa, "ar"):                     # the address fields line by line
    print([(f.field, f.label, f.required) for f in line])
print(len(subdivisions("SA")))

Metadata

Release files for worldref 1.2.0

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

Source distribution (sdist)

Source distribution for worldref 1.2.0
File Size Uploaded Provenance Actions
worldref-1.2.0.tar.gz 201.2 kB With provenance Details for worldref-1.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 408.3 kB

Release files / worldref-1.2.0.tar.gz

Download URL worldref-1.2.0.tar.gz
Size 201.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5c4165cfe2ed6a1d9681a12401b9b60195dc734e069a5b0fe83417685a2ade94
BLAKE2b-256 checksum
How to use checksums
db5620d4602a4de114fb0016afa45cc87e85bbb3fa14b010be5556ca9d4fc00e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Release files / worldref-1.2.0-py3-none-any.whl

Download URL worldref-1.2.0-py3-none-any.whl
Size 207.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe56ebd218d603a36cd8133eb37a2940bcd134a582ec4d160cd53a8751239027
BLAKE2b-256 checksum
How to use checksums
9680f4d3eab839b9698f5b729648d53d17872c17e375db39dab850ba1eae9dbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Security for worldref 1.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for worldref-1.2.0.tar.gz

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 Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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