Skip to main content

A modern Python library for country data

Project description

CountryPy

GitHub repo size

CountryPy

Description

CountryPy is a lightweight & efficient modern country data library, used for fetching information about a variety of countries with support for command-line interface (CLI).

Installation

Python 3.6+ is required

# MacOS / Linux (via Terminal)
python3 -m pip install -U countrypy

# Windows (via CMD Prompt)
py -3 -m pip install -U countrypy

Quick Start

>>> from countrypy import Country
>>> country = Country("United States of America")
>>> print(f"Capital: {country.capital}")
'Washington, D.C'

Search

>>> from countrypy import Search
>>> searching = Search(Search.timezones, "UTC-12:00")
>>> print(searching)
'United States'

CLI Quick Start

$ countrypy quickinfo US

Take a look at more examples in the examples folder!

v1.1.0 Changes

v1.1.0

  • [ADDED] Added Search option & search_by for CLI - you can now sort countries by data such as timezones & languages!
  • [ADDED] Added more error handling
  • [MODIFIED] Changed API URL to use filters to reduce load time
  • [PATCH] Fixed a bug for both CLI and non-cli with phone country codes and their suffixes

Want to contribute?

Take a look at the contributing guidelines!


© Arjun Sharda 2024-present
All Rights Reserved

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

countrypy-1.1.0.tar.gz (11.2 kB view hashes)

Uploaded Source

Built Distribution

countrypy-1.1.0-py3-none-any.whl (11.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page