Skip to main content

Welcome to PyCountryCode's documentation!

What it is? I have always loved knowing stuff. I love knowledge, it is my first love before anything else. In every kind of setup I finf myself in I am always participating because I almost always have an idea about most things. This love of knowledge also made it easy for me to know more country telephone codes.

However, the truth is I couldn't cram them all the country codes and retrieve them from my mind everytime it became necessary. I knew by heart those of the most popular countries that includes Russia (+7), UK (+44), USA (+1), Australia (+61) and of course Zimbabwe amongst many others.

Why? Someone wanted to know what code +52 was for which country, I didn't know, I was embarrassed at myself. I challenged myself by writing this package so I and anyone else can use to get the country calling code of any country and also to get a country after passing in a calling code you know but are not sure about the country of origin.

Inspiration I wanted to write something that others could find useful.

Installation pip install pycountrycode

Importing the 'code' function from pycountrycode.pycountrycode import code

  • code('Zimbabwe')
  • '+263'
  • code('New Zealand')
  • '+64'
  • code('Peru')
  • '+51'
  • code('Madagascar')
  • '+261'
  • code('Russia')
  • '+7'
  • code('Australia')
  • '+61'
  • code('Israel')
  • '+972'

importing the 'phoneCode' function. from pycountrycode.countrycode import phoneCode

  • phoneCode('+52')
  • 'Mexico'
  • phoneCode('+56')
  • 'Easter Island'
  • phoneCode('+1')
  • 'United States of America'
  • phoneCode('+7')
  • 'Russia'
  • phoneCode('+44')
  • 'Britain'
  • phoneCode('+86')
  • 'China'

Metadata

Release files for pycountrycode 1.1.4

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

Source distribution (sdist)

Source distribution for pycountrycode 1.1.4
File Size Uploaded
pycountrycode-1.1.4.tar.gz 6.9 kB Details

Built distribution (wheel)

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

Total release size: 18.3 kB

Release files / pycountrycode-1.1.4.tar.gz

Download URL pycountrycode-1.1.4.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
181c1a1bd6ebb7c3e56f3b96d8a202dabad66ce2bdb544480af9b9b54d67d5b4
BLAKE2b-256 checksum
How to use checksums
1027efe2bd2cf9b56cc946b135488eb1e51488117d6eae3f4e46543af17cf472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / pycountrycode-1.1.4-py3-none-any.whl

Download URL pycountrycode-1.1.4-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b07c4c2178bd8282ae79b132351493b184d2c5f883178725b8c9f7929c08f077
BLAKE2b-256 checksum
How to use checksums
80930f416f2eaeaca580fc71f6acbc062629899d348b36641f3baf8e56ccc4ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

This release

1.1.4 This release

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

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