Skip to main content

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

Release files for countrypy 1.1.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 countrypy 1.1.0
File Size Uploaded
countrypy-1.1.0.tar.gz 11.2 kB Details

Built distribution (wheel)

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

Total release size: 22.7 kB

Release files / countrypy-1.1.0.tar.gz

Download URL countrypy-1.1.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0136ba116b678165a9d30fc91a0678ba7a0b5791473e4fc71eb89e6c9b26b61f
BLAKE2b-256 checksum
How to use checksums
8a6875c94274baf28ddd302e9e8290d3d1b9dcc10cbcdf3b930b2dbda4d2219f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / countrypy-1.1.0-py3-none-any.whl

Download URL countrypy-1.1.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f0f703f06c758f2c03e123384b2420dd8f1b5f9cd5e1f1e2aa268f6128656f1
BLAKE2b-256 checksum
How to use checksums
4d2ac3354913b43bd9c4113490b9aff4b74ef358f8963fbec2d27ae26311522f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

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