A modern Python library for country data
Project description
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
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
countrypy-1.1.0.tar.gz
(11.2 kB
view details)
Built Distribution
countrypy-1.1.0-py3-none-any.whl
(11.4 kB
view details)
File details
Details for the file countrypy-1.1.0.tar.gz
.
File metadata
- Download URL: countrypy-1.1.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0136ba116b678165a9d30fc91a0678ba7a0b5791473e4fc71eb89e6c9b26b61f |
|
MD5 | a4e265bbe3a2106642af33c03607ed58 |
|
BLAKE2b-256 | 8a6875c94274baf28ddd302e9e8290d3d1b9dcc10cbcdf3b930b2dbda4d2219f |
File details
Details for the file countrypy-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: countrypy-1.1.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f0f703f06c758f2c03e123384b2420dd8f1b5f9cd5e1f1e2aa268f6128656f1 |
|
MD5 | 07b8da924f494f535c1bf669be3e7463 |
|
BLAKE2b-256 | 4d2ac3354913b43bd9c4113490b9aff4b74ef358f8963fbec2d27ae26311522f |